Fix crash in QDesktopServices::openUrl() without QGuiApplication

Change-Id: Ib1a66c71725dac8fd7ba7ef3d432667b210df778
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bb10
Tasuku Suzuki 2015-03-12 02:23:53 +09:00
parent d0d107ffc8
commit f901b75926
1 changed files with 6 additions and 1 deletions

View File

@ -185,7 +185,12 @@ bool QDesktopServices::openUrl(const QUrl &url)
}
if (!url.isValid())
return false;
QPlatformServices *platformServices = QGuiApplicationPrivate::platformIntegration()->services();
QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration();
if (!platformIntegration)
return false;
QPlatformServices *platformServices = platformIntegration->services();
if (!platformServices) {
qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO);
return false;