From b512ec7c97d670b1f8043cb73c176e89b194b842 Mon Sep 17 00:00:00 2001 From: ketmar Date: Sat, 20 Aug 2016 23:21:40 +0000 Subject: [PATCH] skip gcli registration if there is no gcli; 3.5 FossilOrigin-Name: a41a42e9009ad86b58e91671a6a8e9c7eeeaa22855f8c712e7afc4e0b61cbad5 --- install.rdf | 4 ++-- main/modules/concmd.js | 4 ++++ main/modules/sbapi/scriptstorage.js | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install.rdf b/install.rdf index b3f4be7..07ab2a8 100644 --- a/install.rdf +++ b/install.rdf @@ -2,7 +2,7 @@ guerilla@ketmar.no-ip.org - 0.0.3.6.4rc0 + 0.0.3.6.5 2 Guerilla Scripting Userscript injecting engine for power users. @@ -49,7 +49,7 @@ {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} 25.0 - 26.* + 27.* diff --git a/main/modules/concmd.js b/main/modules/concmd.js index 2744210..0af58d3 100644 --- a/main/modules/concmd.js +++ b/main/modules/concmd.js @@ -450,6 +450,8 @@ let gcliCommandSpecs = [ //////////////////////////////////////////////////////////////////////////////// registerStartupHook("gcli", function () { + if (typeof(gcli) === "undefined") return; + if (typeof(gcli.addCommand) !== "function") return; for (let cmd of gcliCommandSpecs) { if (cmd && typeof(cmd) === "object" && cmd.name) gcli.addCommand(cmd); } @@ -457,6 +459,8 @@ registerStartupHook("gcli", function () { registerShutdownHook("gcli", function () { + if (typeof(gcli) === "undefined") return; + if (typeof(gcli.removeCommand) !== "function") return; for (let cmd of gcliCommandSpecs) { if (cmd && typeof(cmd) === "object" && cmd.name) gcli.removeCommand(cmd); } diff --git a/main/modules/sbapi/scriptstorage.js b/main/modules/sbapi/scriptstorage.js index aebc945..a288077 100644 --- a/main/modules/sbapi/scriptstorage.js +++ b/main/modules/sbapi/scriptstorage.js @@ -86,6 +86,8 @@ ScriptStorage.prototype.setValue = function (name, val) { this.deleteValue(name); return; } + //if (name === undefined) return; + //if (typeof(name) === "Object") return; let stmt = this.db.createStatement("INSERT OR REPLACE INTO scriptvals (name, value) VALUES (:name, :value)"); try { stmt.params.name = name; -- 2.11.4.GIT