Skip to content

Commit 4b91627

Browse files
committed
fix template context assumed to always exist
1 parent 24606fe commit 4b91627

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/core/src/lib/renderer/react-template.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export class ReactTemplate<TContext extends object | void> extends React.Compone
6262

6363
componentDidUpdate() {
6464
// Context has changes, trigger change detection after pushing the new context in
65-
Object.assign(this._embeddedViewRef.context, this.props.context);
65+
if (this.props.context != null && this._embeddedViewRef.context != null) {
66+
Object.assign(this._embeddedViewRef.context, this.props.context);
67+
}
6668
this._embeddedViewRef.detectChanges();
6769
}
6870

0 commit comments

Comments
 (0)