From ed890714c184fb92e7bac8c81a746e93c0bc3d11 Mon Sep 17 00:00:00 2001 From: adkinsrs Date: Mon, 26 Aug 2024 10:07:31 -0400 Subject: [PATCH] warning if pattern from url param is not found --- www/js/projection.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/js/projection.js b/www/js/projection.js index 1aa1b6c7..7b777c76 100644 --- a/www/js/projection.js +++ b/www/js/projection.js @@ -301,6 +301,10 @@ const parsePatternCartURLParams = async () => { } urlParamsPassed = true; const foundPattern = flatPatternsCartData.find((p) => p.share_id === pattern); + if (!foundPattern) { + console.warn(`Pattern ${pattern} not found in pattern cart data. Perhaps the user does not have access to it.`); + return; + } selectedPattern = {shareId: foundPattern.share_id, label: foundPattern.label, gctype: foundPattern.gctype, selectedWeights: []}; // Update proxy so that multi-gene radio button can be enabled/disabled