bugfix: Cannot set property 'id' of null

Sometimes snapshot === null, but condition don't take this into account
Merge pull request #187 from zag2art/master

bugfix: Cannot set property 'id' of null