From dbd6bfc10331c23972175bf729ccb4e0e75bcba9 Mon Sep 17 00:00:00 2001 From: Thomas Arp <357770+welcor@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:12:55 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 4: Redundant null check due to previous dereference (#173) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/dg_variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dg_variables.c b/src/dg_variables.c index 0930889..dd6b11a 100644 --- a/src/dg_variables.c +++ b/src/dg_variables.c @@ -486,7 +486,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig, } /* Addition inspired by Jamie Nelson. */ else if (!str_cmp(var, "findobj")) { - if (!field || !*field || !subfield || !*subfield) { + if (!*field || !subfield || !*subfield) { script_log("findobj.vnum(ovnum) - illegal syntax"); strcpy(str, "0"); } else {