Skip to content

Commit

Permalink
fix(toJs): fix "Cannot read property 'ctor' of null"
Browse files Browse the repository at this point in the history
Apparently `typeof null` is `"object"`!

Reported by @simonh1000 on Discourse [1].

[1]: https://discourse.elm-lang.org/t/elm-remotedev-elm-redux-devtools-extension-integration/996/6
  • Loading branch information
utkarshkukreti committed Mar 24, 2018
1 parent 97bde04 commit 0860430
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -11,7 +11,7 @@ const toAction = msg => {
};

const toJs = model => {
if (typeof model === 'object') {
if (model && typeof model === 'object') {
switch (model.ctor) {
// Empty List.
case '[]':
Expand Down

0 comments on commit 0860430

Please sign in to comment.