From 5b23593fd2a63cd24327bbe17da1c47395654146 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 8 Jun 2023 15:11:17 -0400 Subject: [PATCH] Let accounts without the emoticon account data to create emojis/stickers This check worked for accounts that already had custom emojis, but if it never had any added, m_images was never filled and the model would crash when adding more. --- src/models/accountemoticonmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/accountemoticonmodel.cpp b/src/models/accountemoticonmodel.cpp index 237c98d64..b6968a7bf 100644 --- a/src/models/accountemoticonmodel.cpp +++ b/src/models/accountemoticonmodel.cpp @@ -96,10 +96,10 @@ void AccountEmoticonModel::setConnection(Connection *connection) void AccountEmoticonModel::reloadEmoticons() { - if (!m_connection->hasAccountData("im.ponies.user_emotes"_ls)) { - return; + QJsonObject json; + if (m_connection->hasAccountData("im.ponies.user_emotes"_ls)) { + json = m_connection->accountData("im.ponies.user_emotes"_ls)->contentJson(); } - auto json = m_connection->accountData("im.ponies.user_emotes"_ls)->contentJson(); const auto &content = ImagePackEventContent(json); beginResetModel(); m_images = content;