Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Make _updateCollectionData null-safe #4

Open
sionzee opened this issue Jun 29, 2018 · 1 comment
Open

Make _updateCollectionData null-safe #4

sionzee opened this issue Jun 29, 2018 · 1 comment

Comments

@sionzee
Copy link

sionzee commented Jun 29, 2018

When you scope your data eg.
let $scope = model.scope('_page.variable') And set it to null
$scope.set(null);
In method react-sharedb/lib/subscribe.js: _updateCollectionData, will be called:
this.data = (0, _observerUtil.observable)(this.data);
Where this.data == null;
In observer methods it will test if it is not instrument and call on it:
var constructor = ref.constructor Where ref will be null.

Temporary fix for this is to set false insteadof null.

@cray0000
Copy link
Member

good catch. Though it's better to use model.del() for such operations. I'll take a look at how to patch it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants