Skip to content

Commit

Permalink
Merge pull request #2287 from umbraco/v14/bugfix/context-data-null-ref
Browse files Browse the repository at this point in the history
Fix null ref exception in Context Data
  • Loading branch information
nielslyngsoe authored Sep 13, 2024
2 parents 8725950 + ee3a742 commit a95086b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/context-api/debug/context-data.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function contextItemData(contextInstance: any): UmbDebugContextItemData {

case 'object':
// Check if the object is an observable (by checking if it has a subscribe method/function)
const isSubscribeLike = 'subscribe' in value && typeof value['subscribe'] === 'function';
const isSubscribeLike = value && 'subscribe' in value && typeof value['subscribe'] === 'function';
const isWebComponent = value instanceof HTMLElement;

let valueToDisplay = 'Complex Object';
Expand Down

0 comments on commit a95086b

Please sign in to comment.