Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 53237d2

Browse filesBrowse files
authored
add exception for code that shoukd not happen (#2074)
1 parent 81673ba commit 53237d2
Copy full SHA for 53237d2

File tree

1 file changed

+7
-0
lines changed
Filter options

1 file changed

+7
-0
lines changed

‎src/functional/updateIn.js

Copy file name to clipboardExpand all lines: src/functional/updateIn.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ function updateInDeeply(
4747
);
4848
}
4949
const key = keyPath[i];
50+
51+
if (typeof key === 'undefined') {
52+
throw new TypeError(
53+
'Index can not be undefined in updateIn(). This should not happen'
54+
);
55+
}
56+
5057
const nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET);
5158
const nextUpdated = updateInDeeply(
5259
nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.