From 16ff60d24da00de79d5657465d6561dc3e619ae6 Mon Sep 17 00:00:00 2001 From: Rohan Vazarkar Date: Thu, 1 Sep 2016 09:47:44 -0400 Subject: [PATCH] Disallow blank search --- src/components/SearchContainer/SearchContainer.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SearchContainer/SearchContainer.jsx b/src/components/SearchContainer/SearchContainer.jsx index 9f01e22dc..651a36ad0 100644 --- a/src/components/SearchContainer/SearchContainer.jsx +++ b/src/components/SearchContainer/SearchContainer.jsx @@ -173,8 +173,10 @@ export default class SearchContainer extends Component { return; } if (!this.state.pathfindingIsOpen) { - var statement = "MATCH (n) WHERE n.name =~ '(?i).*{}.*' RETURN n".format(escapeRegExp(start)); - emitter.emit('searchQuery', statement) + if (start !== ""){ + var statement = "MATCH (n) WHERE n.name =~ '(?i).*{}.*' RETURN n".format(escapeRegExp(start)); + emitter.emit('searchQuery', statement) + } } else { var start = jQuery(this.refs.searchbar).val(); var end = jQuery(this.refs.pathbar).val();