From 0c0722f3b7cbb751a2fc911612a599cf03c333d4 Mon Sep 17 00:00:00 2001 From: Vasily Kiniv Date: Mon, 27 May 2024 01:00:24 +0300 Subject: [PATCH] fix(view.js): fix crash on style.delete() when `interactive` prop is set to `false` When `interactive` prop is set to `false`, `this.style` remains null, but component's `componentWillUnmount` method still tries to delete and crash. --- src/core/View.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/View.js b/src/core/View.js index ac48c01..de572b9 100644 --- a/src/core/View.js +++ b/src/core/View.js @@ -427,10 +427,12 @@ export default class View extends Component { this.interactor.setInteractorStyle(null); } - this.style.delete(); + if (this.style) { + this.style.delete(); + this.style = null; + } this.defaultStyle.delete(); this.defaultStyle = null; - this.style = null; this.renderer = null; this.selector = null; this.orientationWidget = null;