Skip to content

Commit cd2667c

Browse files
committed
fix(componentLifecycleDecorator): check _unregisterEvents before calling
* Closes #117
1 parent 2e6da96 commit cd2667c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/componentLifecycleDecorator.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default function componentLifecycleDecorator({ registerEvents, instanceMe
1010
}
1111

1212
function unregister() {
13-
this._unregisterEvents();
14-
this._unregisterEvents = null;
13+
if (this._unregisterEvents) {
14+
this._unregisterEvents();
15+
this._unregisterEvents = null;
16+
}
1517
}
1618

1719
function noop() {}

0 commit comments

Comments
 (0)