From 53faca589b021f01c7af5980c8c0e98b58c02e4c Mon Sep 17 00:00:00 2001 From: David Walsh Date: Fri, 15 Dec 2017 17:28:08 -0600 Subject: [PATCH] Fix #4924 - Prevent NaN result count (#4925) --- src/components/QuickOpenModal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/QuickOpenModal.js b/src/components/QuickOpenModal.js index f80f5dee3b..426bf5b614 100644 --- a/src/components/QuickOpenModal.js +++ b/src/components/QuickOpenModal.js @@ -242,7 +242,14 @@ export class QuickOpenModal extends Component { } }; - resultCount = () => (this.state.results ? this.state.results.length : 0); + resultCount = () => { + const results = this.state.results; + + if (results && results.length) { + return results.length; + } + return 0; + }; isSymbolSearch = () => ["functions", "variables"].includes(this.props.searchType);