Fix error handling in FrameworkView component

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-04-09 09:39:59 -07:00
parent 7e6fa44923
commit 92ed01a822
2 changed files with 7 additions and 2 deletions

View File

@@ -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

View File

@@ -42,8 +42,12 @@ function FrameworkViewContent({
queryRef
);
if (!data.node.firstControl) {
return null;
if (!data?.node) {
return <div>Framework not found</div>;
}
if (!data.node.firstControl?.edges?.length) {
return <div>No controls found for this framework</div>;
}
return <Control controlKey={data.node.firstControl.edges[0].node} />;