diff --git a/src/debug/AssertInGuiThread.hpp b/src/debug/AssertInGuiThread.hpp index 6dc144963b3..8c71d5e2402 100644 --- a/src/debug/AssertInGuiThread.hpp +++ b/src/debug/AssertInGuiThread.hpp @@ -8,7 +8,14 @@ namespace chatterino { static bool isGuiThread() { - return QCoreApplication::instance()->thread() == QThread::currentThread(); + auto instance = QCoreApplication::instance(); + + if (instance != nullptr) + { + return instance->thread() == QThread::currentThread(); + } + + return false; } static void assertInGuiThread()