From b4f563282bfee1b8b0aa299aa4fbeebddacadd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 9 Dec 2019 11:32:42 +0100 Subject: [PATCH] MOBILE-3201 libs: Fix sortProperties null object error --- src/providers/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/utils/utils.ts b/src/providers/utils/utils.ts index 31834a365..4f71eede7 100644 --- a/src/providers/utils/utils.ts +++ b/src/providers/utils/utils.ts @@ -1252,7 +1252,7 @@ export class CoreUtilsProvider { * @return Sorted object. */ sortProperties(obj: object): object { - if (typeof obj == 'object' && !Array.isArray(obj)) { + if (obj != null && typeof obj == 'object' && !Array.isArray(obj)) { // It's an object, sort it. return Object.keys(obj).sort().reduce((accumulator, key) => { // Always call sort with the value. If it isn't an object, the original value will be returned.