diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-12 23:59:57 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-12 23:59:57 -0500 |
commit | 72935b055840b78ddc260af01134003798ca4308 (patch) | |
tree | cc602f95566bf9be453299469d778420af03e7df /src/components | |
parent | c9647f9b33ddb07e44d008ef1097852a62df1816 (diff) | |
download | abaddon-portaudio-72935b055840b78ddc260af01134003798ca4308.tar.gz abaddon-portaudio-72935b055840b78ddc260af01134003798ca4308.zip |
dont crash immediately if gif pixbufloader doesnt exist
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/chatinputindicator.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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) { |