From b72a59cdea10afd2501bd23fb14695ee49e81834 Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:00:55 +0200 Subject: [PATCH 1/2] Fix Geni Add --- popup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/popup.js b/popup.js index cb2aff6..1b37ced 100644 --- a/popup.js +++ b/popup.js @@ -1286,6 +1286,7 @@ function buildTree(data, action, sendid) { variable: {id: id, relation: action.replace("add-", ""), data: data} }, function (response) { try { + if (response) { var result = JSON.parse(response.source); if (verboselogs) { console.log("Geni Response: " + response.source); @@ -1294,6 +1295,7 @@ function buildTree(data, action, sendid) { noerror = false; updateMessage(errormsg, 'There was a problem updating Geni with a ' + response.variable.relation + '. ' + 'Error Response: "' + result.error.message + '"'); } + } } catch (e) { noerror = false; var extrainfo = ""; From a9e03167424392f511aac375c43a6a2d29aae230 Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:08:47 +0200 Subject: [PATCH 2/2] Fix --- popup.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/popup.js b/popup.js index 50c7c4c..d81c21b 100644 --- a/popup.js +++ b/popup.js @@ -1287,8 +1287,7 @@ function buildTree(data, action, sendid) { variable: {id: id, relation: action.replace("add-", ""), data: data} }, function (response) { try { - if (response) { - var result = JSON.parse(response.source); + var result = typeof response.source == 'string' ? JSON.parse(response.source) : response.source; if (verboselogs) { console.log("Geni Response: " + response.source); } @@ -1296,7 +1295,6 @@ function buildTree(data, action, sendid) { noerror = false; updateMessage(errormsg, 'There was a problem updating Geni with a ' + response.variable.relation + '. ' + 'Error Response: "' + result.error.message + '"'); } - } } catch (e) { noerror = false; var extrainfo = "";