Skip to content

Commit da639f2

Browse files
authored
Merge pull request #8171 from hamidbsd/NativeScript/NativeScript
fix(8153): null reference exception in view.android.onUnloaded
2 parents ff710b7 + eee7040 commit da639f2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ tag the release and update the CHANGELOG.md. Don't forget to check the auto-gene
266266
cd nativescript-core
267267
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
268268
cd ..
269+
```
269270

270271
5. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
271272
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md

‎nativescript-core/ui/core/view/view.android.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,13 @@ export class View extends ViewCommon {
380380
@profile
381381
public onUnloaded() {
382382
if (this.touchListenerIsSet) {
383-
this.nativeViewProtected.setOnTouchListener(null);
384383
this.touchListenerIsSet = false;
385-
this.nativeViewProtected.setClickable(this._isClickable);
384+
if (this.nativeViewProtected) {
385+
this.nativeViewProtected.setOnTouchListener(null);
386+
this.nativeViewProtected.setClickable(this._isClickable);
387+
}
386388
}
387-
389+
388390
this._manager = null;
389391
this._rootManager = null;
390392
super.onUnloaded();

0 commit comments

Comments
 (0)