From 1decc763840d47632e41bed7a628e5de7fcaef4d Mon Sep 17 00:00:00 2001 From: Zefir Kirilov Date: Tue, 23 Sep 2025 15:56:06 +0300 Subject: [PATCH] Check that flag match query is not null --- src/cmd/flag.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/flag.d b/src/cmd/flag.d index a5d277d..52c8de8 100644 --- a/src/cmd/flag.d +++ b/src/cmd/flag.d @@ -100,6 +100,8 @@ public class Flag { * query = String to check. */ public bool matches(string query) const nothrow @safe { + if (query == null) + return false; return (query.startsWith("--") && longName == query[2..$]) || (query.startsWith("-") && shortName == query[1..2])