Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/core/src/render3/features/ng_onchanges_feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

import {InputSignalNode} from '../../authoring/input/input_signal_node';
import {OnChanges} from '../../change_detection/lifecycle_hooks';
import {SimpleChange, SimpleChanges} from '../../change_detection/simple_change';
import {assertString} from '../../util/assert';
import {EMPTY_OBJ} from '../../util/empty';
import {applyValueToInputField} from '../apply_value_input_field';
import {DirectiveDef, DirectiveDefFeature} from '../interfaces/definition';
import {SimpleChange, SimpleChanges} from '../../change_detection/simple_change';

/**
* The NgOnChangesFeature decorates a component with support for the ngOnChanges
Expand Down Expand Up @@ -112,7 +112,9 @@ function ngOnChangesSetInput<T>(
const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';

function getSimpleChangesStore(instance: any): null | NgSimpleChangesStore {
return instance[SIMPLE_CHANGES_STORE] || null;
return Object.hasOwn(instance, SIMPLE_CHANGES_STORE)
? instance[SIMPLE_CHANGES_STORE] || null
: null;
}

function setSimpleChangesStore(instance: any, store: NgSimpleChangesStore): NgSimpleChangesStore {
Expand Down
Loading