From 92ed01a82236907678f3dcb0820539b91b5de52a Mon Sep 17 00:00:00 2001 From: gearnode Date: Wed, 9 Apr 2025 09:39:59 -0700 Subject: [PATCH] Fix error handling in FrameworkView component Signed-off-by: gearnode --- CHANGELOG.md | 1 + .../src/pages/organizations/frameworks/FrameworkView.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ca302cf..4fe52c8d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ All notable changes to this project will be documented in this file. - Fix unfoldable mitigation category when open via the URI fragment. - Fix ctrl+click on mitigation does not open new tab. +- Fix error handling in framework view when no controls are available. ## [0.3.0] - 2025-04-01 diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx index bb886f886..be792be48 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx @@ -42,8 +42,12 @@ function FrameworkViewContent({ queryRef ); - if (!data.node.firstControl) { - return null; + if (!data?.node) { + return
Framework not found
; + } + + if (!data.node.firstControl?.edges?.length) { + return
No controls found for this framework
; } return ;