🐛 Fix null value parsing in Google FIrestore (#1749)

This commit is contained in:
Iván Ovejero 2021-05-08 04:59:32 +02:00 committed by GitHub
parent cdbb3acd2d
commit 90d69246d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,9 +112,9 @@ export function documentToJson(fields: IDataObject): IDataObject {
for (const f of Object.keys(fields)) {
const key = f, value = fields[f],
isDocumentType = ['stringValue', 'booleanValue', 'doubleValue',
'integerValue', 'timestampValue', 'mapValue', 'arrayValue'].find(t => t === key);
'integerValue', 'timestampValue', 'mapValue', 'arrayValue', 'nullValue'].find(t => t === key);
if (isDocumentType) {
const item = ['stringValue', 'booleanValue', 'doubleValue', 'integerValue', 'timestampValue']
const item = ['stringValue', 'booleanValue', 'doubleValue', 'integerValue', 'timestampValue', 'nullValue']
.find(t => t === key);
if (item) {
return value as IDataObject;