Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

add null pointer check (#1106)

shun-iwasawa51c8ee5bc1e9
diff --git a/toonz/sources/common/tipc/tipc.cpp b/toonz/sources/common/tipc/tipc.cpp
index e379a9db8..bc9cf1d70 100644
--- a/toonz/sources/common/tipc/tipc.cpp
+++ b/toonz/sources/common/tipc/tipc.cpp
@@ -338,7 +338,8 @@ bool tipc::startSlaveServer(QString srvName, QString cmdline) {
// the *MAIN* thread
// in *this process* exits. So, if this is not the main thread, we must move
// the socket there.
- if (QThread::currentThread() != QCoreApplication::instance()->thread())
+ if (QCoreApplication::instance() &&
+ QThread::currentThread() != QCoreApplication::instance()->thread())
dummySock->moveToThread(QCoreApplication::instance()->thread());
// If a connection error takes place, release the dummy socket.