From 4cd53a030390edc7e95a708a62218cdec4c0ffa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Wed, 11 Dec 2024 02:50:14 +0100 Subject: [PATCH] fix: onInternalMessage: don't fail on non-Odoo pages --- CHANGELOG.md | 1 + src/js/private/background.mjs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d969211..aca9e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ``` FIX: file2base64: Support large files +FIX: onInternalMessage: Don't fail on non-Odoo pages (#141) ``` **11.7.1** diff --git a/src/js/private/background.mjs b/src/js/private/background.mjs index 5b36302..2412311 100644 --- a/src/js/private/background.mjs +++ b/src/js/private/background.mjs @@ -38,7 +38,7 @@ function updateBrowserAction(icon: string, text: string | null, bg_color: string function onInternalMessage(request: Object, sender: Object) { if (request.message === 'update_terminal_badge_info') { const {context} = request; - const ver_clean = sanitizeOdooVersion(context.serverVersion.raw); + const ver_clean = sanitizeOdooVersion(context?.serverVersion?.raw) || ""; if (context.isCompatible) { ubrowser.action.enable(sender.tab.id); let color;