0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Add error check for no brew found

This commit is contained in:
G.Ambatte
2024-10-25 11:17:44 +13:00
parent e3619bb1fc
commit 28894adeab

View File

@@ -31,7 +31,7 @@ const BrewLookup = createClass({
request.get(`/admin/lookup/${this.state.query}`)
.then((res)=>{
const foundBrew = res.body;
const scriptCheck = foundBrew.text.match(/(<\/?s)cript/g);
const scriptCheck = foundBrew?.text.match(/(<\/?s)cript/g);
this.setState({
foundBrew : foundBrew,
scriptCount : scriptCheck?.length || 0,