From fd40e7597db62d8559f2b9c2753f61018094d4a5 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Tue, 11 Jun 2019 14:34:40 -0500 Subject: [PATCH] Prevent null pointer exception from while scrolling from crashing the app --- src/view/cli.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/view/cli.js b/src/view/cli.js index d626a5c52..1ea11453b 100644 --- a/src/view/cli.js +++ b/src/view/cli.js @@ -90,13 +90,13 @@ class LogOutput extends Component { } get printLogs() { - this.tailLogs(); + this._tScroll = setTimeout(() => this.tailLogs(), 50); return this.props.logs; } tailLogs() { - const opt = { animated: false }; - this._tScroll = setTimeout(() => this._ref.current.scrollToEnd(opt), 50); + const view = this._ref && this._ref.current; + view && view.scrollToEnd({ animated: false }); } render() {