Skip to content

Commit 04fb6e0

Browse files
author
culler
committed
Fix [080a28104e]: crash caused by nil UTType when user provides a bogus file type.
1 parent 5bde407 commit 04fb6e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

macosx/tkMacOSXDialog.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ static void setAllowedFileTypes(
3737
NSMutableArray<UTType *> *allowedTypes = [NSMutableArray array];
3838
for (NSString *ext in extensions) {
3939
UTType *uttype = [UTType typeWithFilenameExtension: ext];
40-
[allowedTypes addObject:uttype];
40+
if (uttype) {
41+
[allowedTypes addObject:uttype];
42+
}
4143
}
4244
[panel setAllowedContentTypes:allowedTypes];
4345
} else {

0 commit comments

Comments
 (0)