diff --git a/package.json b/package.json index aecf07e..f622ce1 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "test:watch": "eslint --fix && jest --updateSnapshot --watchAll" }, "types": "dist/index.d.ts", - "version": "1.1.0-alpha.14", + "version": "1.1.0-alpha.15", "dependencies": { "@webkrafters/eagleeye": "^1.0.8", "js-sha512": "^0.9.0", diff --git a/src/main/universe/index.tsx b/src/main/universe/index.tsx index 4bd179d..26eef7d 100644 --- a/src/main/universe/index.tsx +++ b/src/main/universe/index.tsx @@ -410,7 +410,15 @@ export class ObservableUniverse { } else { mounted.current = true; } - const fn = () => setStore({ ...store, data: channel.data }); + const fn = () => { + try { setStore({ ...store, data: channel.data }) } catch( e ) { + /* allow system gc to clean up scheduled freed streams */ + /* istanbul ignore next */ + if( !( e as Error ).message.includes( + "Cannot read properties of null (reading 'getState')" + ) ) { throw e } + } + } channel.addListener( 'data-changed', fn ); return () => { channel.removeListener( 'data-changed', fn );