mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-06 19:12:30 +01:00
Fix crash when accessing connection pointer
This smart pointer only gets set when the Wallpaper is connected.
This commit is contained in:
parent
8615d7371f
commit
379d0c998b
@ -139,6 +139,12 @@ QJsonObject ScreenPlayWallpaper::getActiveSettingsJson()
|
|||||||
*/
|
*/
|
||||||
void ScreenPlayWallpaper::messageQuit()
|
void ScreenPlayWallpaper::messageQuit()
|
||||||
{
|
{
|
||||||
|
// When the wallpaper never connected, this is invalid
|
||||||
|
if (!m_connection) {
|
||||||
|
qCritical() << "Cannot request quit, wallpaper never connected!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject obj;
|
QJsonObject obj;
|
||||||
obj.insert("command", "quit");
|
obj.insert("command", "quit");
|
||||||
m_connection->sendMessage(QJsonDocument(obj).toJson(QJsonDocument::Compact));
|
m_connection->sendMessage(QJsonDocument(obj).toJson(QJsonDocument::Compact));
|
||||||
|
Loading…
Reference in New Issue
Block a user