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

@@ -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} />;