1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix crash when accessing connection pointer

This smart pointer only gets set when the Wallpaper
is connected.
This commit is contained in:
Elias Steurer 2021-10-24 14:40:29 +02:00
parent 8615d7371f
commit 379d0c998b

View File

@ -139,6 +139,12 @@ QJsonObject ScreenPlayWallpaper::getActiveSettingsJson()
*/
void ScreenPlayWallpaper::messageQuit()
{
// When the wallpaper never connected, this is invalid
if (!m_connection) {
qCritical() << "Cannot request quit, wallpaper never connected!";
return;
}
QJsonObject obj;
obj.insert("command", "quit");
m_connection->sendMessage(QJsonDocument(obj).toJson(QJsonDocument::Compact));