Skip to content

Commit d65baaf

Browse files
committed
don't crash with bad ExternalViewers entri
1 parent d0aeef6 commit d65baaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Menu.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,18 +1148,18 @@ static void AppendExternalViewersToMenu(HMENU menuFile, const WCHAR* filePath) {
11481148
if (count >= maxEntries) {
11491149
break;
11501150
}
1151-
if (!ev->commandLine) {
1151+
if (str::EmptyOrWhiteSpaceOnly(ev->commandLine)) {
11521152
continue;
11531153
}
11541154
if (ev->filter && !(filePath && PathMatchFilter(filePath, ev->filter))) {
11551155
continue;
11561156
}
11571157

11581158
WCHAR* name = ToWstrTemp(ev->name);
1159-
if (str::IsEmpty(name)) {
1159+
if (str::EmptyOrWhiteSpaceOnly(ev->name)) {
11601160
CmdLineArgsIter args(ToWstrTemp(ev->commandLine));
11611161
int nArgs = args.nArgs - 2;
1162-
if (nArgs == 0) {
1162+
if (nArgs <= 0) {
11631163
continue;
11641164
}
11651165
WCHAR* arg0 = args.at(2 + 0);

0 commit comments

Comments
 (0)