Skip to content

Commit 64d7216

Browse files
committed
Bugfix: don’t allow ValueComponent to return undefined from its reducer.
1 parent 0103f2d commit 64d7216

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ValueComponent.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default ValueComponent = createClass {
1212

1313
getReducer: -> (state = null, action) ->
1414
if action.type is @SET
15-
action.payload
15+
# Reducer may not return undefined. Promote to null.
16+
if action.payload is undefined then null else action.payload
1617
else
1718
state
1819

0 commit comments

Comments
 (0)