From d65baaf49977e8be62fbe26e5c155424e25c69ee Mon Sep 17 00:00:00 2001 From: Krzysztof Kowalczyk Date: Wed, 1 Jun 2022 21:08:50 -0400 Subject: [PATCH] don't crash with bad ExternalViewers entri --- src/Menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Menu.cpp b/src/Menu.cpp index 762859563a7c..dc4bd16862f2 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -1148,7 +1148,7 @@ static void AppendExternalViewersToMenu(HMENU menuFile, const WCHAR* filePath) { if (count >= maxEntries) { break; } - if (!ev->commandLine) { + if (str::EmptyOrWhiteSpaceOnly(ev->commandLine)) { continue; } if (ev->filter && !(filePath && PathMatchFilter(filePath, ev->filter))) { @@ -1156,10 +1156,10 @@ static void AppendExternalViewersToMenu(HMENU menuFile, const WCHAR* filePath) { } WCHAR* name = ToWstrTemp(ev->name); - if (str::IsEmpty(name)) { + if (str::EmptyOrWhiteSpaceOnly(ev->name)) { CmdLineArgsIter args(ToWstrTemp(ev->commandLine)); int nArgs = args.nArgs - 2; - if (nArgs == 0) { + if (nArgs <= 0) { continue; } WCHAR* arg0 = args.at(2 + 0);