From dd010f03e511104d9c4f92f346cae95669b0cac5 Mon Sep 17 00:00:00 2001 From: TheDevRyan <175502913+The-Dev-Ryan@users.noreply.github.com> Date: Mon, 17 Nov 2025 10:33:48 +0000 Subject: [PATCH] Fix deviceViewPanel to properly initialize panel entries (#7433) Corrects the logic in deviceViewPanel to ensure that each plugin's panel entry is initialized as an object with header and content properties, and checks for the existence of both on_device_header and on_device_page functions before invoking them. --- pluginHandler.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index 6276cb4e..4b8f5b81 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -200,10 +200,12 @@ module.exports.pluginHandler = function (parent) { obj.deviceViewPanel = function () { var panel = {}; for (var p in obj.plugins) { - if (typeof obj.plugins[p][hookName] == 'function') { + if (typeof obj.plugins[p].on_device_header === "function" && typeof obj.plugins[p].on_device_page === "function") { try { - panel[p].header = obj.plugins[p].on_device_header(); - panel[p].content = obj.plugins[p].on_device_page(); + panel[p] = { + header: obj.plugins[p].on_device_header(), + content: obj.plugins[p].on_device_page() + }; } catch (e) { console.log("Error occurred while getting plugin views " + p + ':' + ' (' + e + ')'); }