Skip to content

Commit 93ad60d

Browse files
committed
Use a null check when checking for existence to be consistent with snapshot 'exists'
1 parent 9d57c28 commit 93ad60d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/firestore-document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ MockFirestoreDocument.prototype.get = function () {
8888
};
8989

9090
MockFirestoreDocument.prototype._validateDoesNotExist = function (data) {
91-
if (data) {
91+
if (data !== null) {
9292
var err = new Error('Cannot create a document which already exists');
9393
err.code = 'firestore/already-exists';
9494
return err;

0 commit comments

Comments
 (0)