Merge pull request #2287 from umbraco/v14/bugfix/context-data-null-ref

Fix null ref exception in Context Data
This commit is contained in:
Niels Lyngsø
2024-09-13 16:38:36 +02:00
committed by GitHub

View File

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