From fd4d7cc5c7cf3458a139073309a76c7ab3798577 Mon Sep 17 00:00:00 2001 From: Luiz Claudio Date: Tue, 25 Dec 2018 18:22:39 -0300 Subject: [PATCH] Fixes error when the input search is empty --- src/App.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 44c0cca..b044c0b 100644 --- a/src/App.js +++ b/src/App.js @@ -184,7 +184,13 @@ class App extends Component { }; onSubmit = event => { - this.onFetchFromGitHub(this.state.path); + if (this.state.path) { + this.onFetchFromGitHub(this.state.path); + } else { + this.setState({ + errors: [{ message: 'Insert a valid search path.' }], + }); + } event.preventDefault(); };