From 28894adeabc3187fa4791091b28bb0c30f422f90 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 25 Oct 2024 11:17:44 +1300 Subject: [PATCH] Add error check for no brew found --- client/admin/brewUtils/brewLookup/brewLookup.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/admin/brewUtils/brewLookup/brewLookup.jsx b/client/admin/brewUtils/brewLookup/brewLookup.jsx index 8814e465a..ab938854e 100644 --- a/client/admin/brewUtils/brewLookup/brewLookup.jsx +++ b/client/admin/brewUtils/brewLookup/brewLookup.jsx @@ -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,