[FIX] store: prevent crash when selector returns null

Because `typeof null === 'object'`.
This commit is contained in:
Sébastien Theys
2019-12-19 11:57:40 +01:00
committed by Géry Debongnie
parent c8d9c0b50e
commit bc2c7edff4
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ export function useStore(selector, options: SelectorOptions = {}): any {
__destroy.call(component, parent);
};
if (typeof result !== "object") {
if (typeof result !== "object" || result === null) {
return result;
}
return new Proxy(result, {