Fix error handling in FrameworkView component
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -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 unfoldable mitigation category when open via the URI fragment.
|
||||||
- Fix ctrl+click on mitigation does not open new tab.
|
- 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
|
## [0.3.0] - 2025-04-01
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,12 @@ function FrameworkViewContent({
|
|||||||
queryRef
|
queryRef
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!data.node.firstControl) {
|
if (!data?.node) {
|
||||||
return null;
|
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} />;
|
return <Control controlKey={data.node.firstControl.edges[0].node} />;
|
||||||
|
|||||||
Reference in New Issue
Block a user