Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 4842e8b

Browse files
authored
Merge pull request #1154 from lightninglabs/dev/cli-prevent-crash
Prevent null pointer exception from while scrolling from crashing the app
2 parents a45dfd4 + fd40e75 commit 4842e8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/view/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ class LogOutput extends Component {
9090
}
9191

9292
get printLogs() {
93-
this.tailLogs();
93+
this._tScroll = setTimeout(() => this.tailLogs(), 50);
9494
return this.props.logs;
9595
}
9696

9797
tailLogs() {
98-
const opt = { animated: false };
99-
this._tScroll = setTimeout(() => this._ref.current.scrollToEnd(opt), 50);
98+
const view = this._ref && this._ref.current;
99+
view && view.scrollToEnd({ animated: false });
100100
}
101101

102102
render() {

0 commit comments

Comments
 (0)