Skip to content

Commit

Permalink
don't render if no inspection available
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
  • Loading branch information
Colin Grant authored and colin-grant-work committed Apr 22, 2021
1 parent 82c2bc4 commit 924115c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ export class PreferencesEditorWidget extends ReactWidget implements StatefulWidg

protected renderSingleEntry(node: TreeNode): React.ReactNode {
const values = this.preferenceValueRetrievalService.inspect<PreferenceItem>(node.id, this.model.currentScope.uri);
const preferenceNodeWithValueInAllScopes = { ...node, preference: { data: this.model.propertyList[node.id], values } };
return this.singlePreferenceFactory.render(preferenceNodeWithValueInAllScopes);
const data = this.model.propertyList[node.id];
if (data && values) {
const preferenceNodeWithValueInAllScopes = { ...node, preference: { data, values } };
return this.singlePreferenceFactory.render(preferenceNodeWithValueInAllScopes);
}
return undefined;
}

protected renderCategoryHeader({ node, visibleChildren }: PreferenceTreeNodeRow): React.ReactNode {
Expand Down

0 comments on commit 924115c

Please sign in to comment.