Fixed issue calling DataSnapshot methods with null data
Description
Fixes https://github.com/firebase/firebase-functions-test/pull/254
Fix is similar to the check in #exists():
https://github.com/firebase/firebase-functions/blob/5f7b331abd5a2a38a4e84de1e51411ea5919c0c3/src/common/providers/database.ts#L173
@taeold IIUC this is a straight bugfix, but I wanted to double check that you don't consider this a breaking change.
Feels like this is a good change and not breaking.
IIUC the change would only break if the traversing the full path instead of short-circuiting somehow had a side effect that was worthy.
@taeold any ideas on the timeline when this might be merged / released?
Sorry I missed that there were tests in the project for this! I've added some tests for the issue to make it clearer.
I've also update the fix as adding tests exposed another issue when this._data is directly null (and not as a result of a child being missing or null).
Anyone any update on this please?
Thank you for your contribution again @rhodgkins