From 6dcb3777ca139e9b378e96374f1b09c3e563ed2f Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 7 Feb 2025 15:57:29 -0500 Subject: [PATCH] dev: fix index_url issue --- src/backend/src/om/entitystorage/AppES.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/backend/src/om/entitystorage/AppES.js b/src/backend/src/om/entitystorage/AppES.js index b26ad86f4..fbbd10d43 100644 --- a/src/backend/src/om/entitystorage/AppES.js +++ b/src/backend/src/om/entitystorage/AppES.js @@ -280,12 +280,17 @@ class AppES extends BaseES { entity.set('created_from_origin', await (async () => { const svc_auth = this.context.get('services').get('auth'); - const origin = origin_from_url( - await entity.get('index_url') - ); - const expected_uid = await svc_auth.app_uid_from_origin(origin); - return expected_uid === await entity.get('uid') - ? origin : null ; + try { + const origin = origin_from_url( + await entity.get('index_url') + ); + const expected_uid = await svc_auth.app_uid_from_origin(origin); + return expected_uid === await entity.get('uid') + ? origin : null ; + } catch (e) { + // This happens when the index_url is not a valid URL + return null; + } })()); // Check if the user is the owner