[database] fix flow issue

This commit is contained in:
Salakar 2018-04-16 10:11:18 +01:00
parent c275e02fcc
commit 5589ed7f4f
1 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,9 @@ export default class DataSnapshot {
// todo this is wrong - child keys needs to be the ordered keys, from FB
// todo potential solution is build up a tree/map of a snapshot and its children
// todo natively and send that back to JS to be use in this class.
childKeys: isObject(value) ? Object.keys(value) : [],
// null check to keep flow happy even though isObject already does this
childKeys: isObject(value) && value !== null ? Object.keys(value) : [],
});
}