aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-06 23:14:32 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-06 23:14:32 +0200
commit4d1c3791cb68e0b17e586b516ea943a31711b223 (patch)
treec3994a346a2a3f88d6c151e87eb9fc696ec33697 /src
parent81f258005b9ab2bb581d3db874b2b581157862ef (diff)
Matrix: fix crash when entering room with no avatar
Diffstat (limited to 'src')
-rw-r--r--src/AsyncImageLoader.cpp1
-rw-r--r--src/QuickMedia.cpp2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/AsyncImageLoader.cpp b/src/AsyncImageLoader.cpp
index 2fc33e8..eaf4564 100644
--- a/src/AsyncImageLoader.cpp
+++ b/src/AsyncImageLoader.cpp
@@ -82,6 +82,7 @@ namespace QuickMedia {
thumbnail_data->loading_state = LoadingState::LOADING;
if(url.empty()) {
+ thumbnail_data->image = std::make_unique<sf::Image>();
thumbnail_data->loading_state = LoadingState::FINISHED_LOADING;
loading_image = false;
return true;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 946438c..bbc6f91 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3619,8 +3619,6 @@ namespace QuickMedia {
sf::Sprite room_avatar_sprite;
auto room_avatar_thumbnail_data = std::make_shared<ThumbnailData>();
AsyncImageLoader async_image_loader;
- if(current_room_body_data)
- async_image_loader.load_thumbnail(current_room_body_data->body_item->thumbnail_url, false, sf::Vector2i(), use_tor, room_avatar_thumbnail_data);
auto typing_async_func = [matrix](bool new_state, std::string room_id) {
if(new_state) {