From 3548a2eb718fb9d32057960aa0fd50cd2988b0f3 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Thu, 14 Mar 2019 20:33:03 +0900 Subject: [PATCH] tracker: Fix PVS V595 Fix 'fFile' pointer was utilized at line 327 before it was verified against NULL. Change-Id: I8214bce9a99d783b3c53a7b8c5696b0b0dfc3490 Reviewed-on: https://review.haiku-os.org/c/haiku/+/1440 Reviewed-by: Adrien Destugues Reviewed-by: waddlesplash --- src/kits/tracker/FindPanel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 3365ce6284..0b62c9e715 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -323,14 +323,14 @@ const char* FindWindow::QueryName() const { if (fFromTemplate) { - if (!fQueryNameFromTemplate.Length()) { + if (!fQueryNameFromTemplate.Length() && fFile != NULL) { fFile->ReadAttrString(kAttrQueryTemplateName, &fQueryNameFromTemplate); } return fQueryNameFromTemplate.String(); } - if (!fFile) + if (fFile == NULL) return ""; return fRef.name;