diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 4ddc8b9a237..f2161fd9a7d 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -379,7 +379,10 @@ typedef QSharedPointer SharedPointerFileDialogOptions; if (!m_helper) return; - if (!(path && path.length) || [path isEqualToString:m_currentDirectory]) + if (!path || [path isEqual:NSNull.null] || !path.length) + return; + + if ([path isEqualToString:m_currentDirectory]) return; [m_currentDirectory release];