From 72935b055840b78ddc260af01134003798ca4308 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:59:57 -0500 Subject: dont crash immediately if gif pixbufloader doesnt exist --- src/components/chatinputindicator.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/components/chatinputindicator.cpp') diff --git a/src/components/chatinputindicator.cpp b/src/components/chatinputindicator.cpp index 9b063b2..ba794f3 100644 --- a/src/components/chatinputindicator.cpp +++ b/src/components/chatinputindicator.cpp @@ -25,16 +25,16 @@ ChatInputIndicator::ChatInputIndicator() if (!std::filesystem::exists(path)) return; auto gif_data = ReadWholeFile(path); auto loader = Gdk::PixbufLoader::create(); - loader->signal_size_prepared().connect([&](int inw, int inh) { - int w, h; - GetImageDimensions(inw, inh, w, h, 20, 10); - loader->set_size(w, h); - }); - loader->write(gif_data.data(), gif_data.size()); try { + loader->signal_size_prepared().connect([&](int inw, int inh) { + int w, h; + GetImageDimensions(inw, inh, w, h, 20, 10); + loader->set_size(w, h); + }); + loader->write(gif_data.data(), gif_data.size()); loader->close(); m_img.property_pixbuf_animation() = loader->get_animation(); - } catch (const std::exception &) {} + } catch (...) {} } void ChatInputIndicator::AddUser(Snowflake channel_id, const UserData &user, int timeout) { -- cgit v1.2.3