fix bug with empty string when logging in
authorxangelo <git@xangelo.ca>
Mon, 19 Dec 2022 16:03:43 +0000 (11:03 -0500)
committerxangelo <git@xangelo.ca>
Mon, 19 Dec 2022 16:03:43 +0000 (11:03 -0500)
src/server.ts

index 7add8509c2cbeb6b322eef587862f09fe159d502..e4c2db75e0ac20826f948cacde1433b3b7002162 100644 (file)
@@ -159,7 +159,12 @@ apiGet('/app', {auth: false}, async (req, res) => {
   return;
 
 }, data => {
-  return data.html.replace(/{ACCOUNT_ID}/g, data.account_id);
+  if(data) {
+    return data.html.replace(/{ACCOUNT_ID}/g, data.account_id);
+  }
+  else {
+    return data;
+  }
 });
 
 apiPost('/accounts/:account_id/feeds', {auth: true}, async (req, res): Promise<any> => {