From c0e2b91fe89ffad6a80bea6e2da1a4e538d2e3ab Mon Sep 17 00:00:00 2001 From: tux3 Date: Sun, 27 Sep 2015 23:45:02 +0200 Subject: [PATCH] Fix #2310 caused by #2309 --- src/core/core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/core.cpp b/src/core/core.cpp index cf713f33f..019f3c5a5 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -764,6 +764,8 @@ void Core::removeGroup(int groupId, bool fake) QString Core::getUsername() const { QString sname; + if (!tox) + return sname; int size = tox_self_get_name_size(tox); uint8_t* name = new uint8_t[size]; tox_self_get_name(tox, name); @@ -830,6 +832,8 @@ QPair Core::getKeypair() const QString Core::getStatusMessage() const { QString sname; + if (!tox) + return sname; size_t size = tox_self_get_status_message_size(tox); uint8_t* name = new uint8_t[size]; tox_self_get_status_message(tox, name);