From d2e671df6505e1964b78155549c74aae94da002a Mon Sep 17 00:00:00 2001 From: Johan Flensmark Date: Fri, 29 Dec 2023 16:56:19 +0100 Subject: [PATCH] fix(util): fix null TypeError in getHashFromImage --- dist/utils/utils.js | 2 +- dist/utils/utils.js.map | 2 +- src/utils/utils.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/utils/utils.js b/dist/utils/utils.js index 082ebc394..3e1620857 100644 --- a/dist/utils/utils.js +++ b/dist/utils/utils.js @@ -157,7 +157,7 @@ exports.substringBeforeLast = substringBeforeLast; // return blurhash.encode(new Uint8ClampedArray(data), info.width, info.height, 4, 3); // }; const getHashFromImage = (url) => { - if (url.length === 0 || url === null) { + if ((url === null || url === void 0 ? void 0 : url.length) === 0) { return ''; } else { diff --git a/dist/utils/utils.js.map b/dist/utils/utils.js.map index 67daf4134..3ad571888 100644 --- a/dist/utils/utils.js.map +++ b/dist/utils/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,qCAA+B;AAKlB,QAAA,UAAU,GACrB,qHAAqH,CAAC;AAC3G,QAAA,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE5F,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,EAAE;IAC7C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IA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G1B;AAEK,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,MAAc,EAAE,EAAE;IAChE,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAHW,QAAA,kBAAkB,sBAG7B;AAEK,MAAM,mBAAmB,GAAG,CAAC,GAAW,EAAE,MAAc,EAAE,EAAE;IACjE,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEF,gDAAgD;AAChD,wBAAwB;AAExB,uCAAuC;AACvC,sDAAsD;AACtD,+CAA+C;AAE/C,yFAAyF;AACzF,kCAAkC;AAClC,WAAW;AAEX,wFAAwF;AACxF,KAAK;AAEE,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9C,IAAI,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,MAAK,CAAC,EAAE;QACrB,OAAO,EAAE,CAAC;KACX;SAAM;QACL,IAAI,IAAa,CAAC;QAClB,uDAAuD;QACvD,OAAO,MAAM,CAAC;KACf;AACH,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B"} \ No newline at end of file diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 5de76db50..9444e6e8b 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -169,7 +169,7 @@ export const substringBeforeLast = (str: string, toFind: string) => { // }; export const getHashFromImage = (url: string) => { - if (url.length === 0 || url === null) { + if (url?.length === 0) { return ''; } else { let hash!: string;