From 7fcaf52c71edec2804ed8dff690f35aaab9b5d70 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Thu, 15 Jun 2023 08:53:16 -0700 Subject: [PATCH] Show error in box if one is available Summary: Add a check to prevent the odd error when the box is no longer available to display an error. Reviewed By: antonk52 Differential Revision: D46763634 fbshipit-source-id: 6ac2c404c842ff989b037c991b5f085baacd2f9a --- desktop/static/index.dev.html | 6 ++++-- desktop/static/index.web.dev.html | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/desktop/static/index.dev.html b/desktop/static/index.dev.html index a7624e2d7..86dddf06b 100644 --- a/desktop/static/index.dev.html +++ b/desktop/static/index.dev.html @@ -81,8 +81,10 @@ } const box = document.querySelector('.__infinity-dev-box-error'); - box.removeAttribute('hidden'); - box.textContent = text; + if (box) { + box.removeAttribute('hidden'); + box.textContent = text; + } } // load correct theme (n.b. this doesn't handle system value specifically, will assume light in such cases) diff --git a/desktop/static/index.web.dev.html b/desktop/static/index.web.dev.html index 77af1f863..64f8808e5 100644 --- a/desktop/static/index.web.dev.html +++ b/desktop/static/index.web.dev.html @@ -109,7 +109,9 @@ } const box = document.getElementById('loading'); - box.textContent = text; + if (box) { + box.textContent = text; + } } window.flipperShowError = openError;