From a0ba21e44271a12a08047af90913bac3eda77434 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Wed, 12 Jan 2022 18:02:11 +0100 Subject: [PATCH] LibGUI: Print error when failing to load thumbnail in FileSystemModel If a thumbnail cannot load it's a good opportunity to print out the error message. On top of that, we still want to update m_thumbnail_progress so that the progress bar doesn't get stuck instead of returning early from the lambda. --- Userland/Libraries/LibGUI/FileSystemModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index e74f90bceb..89840db8b2 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -657,9 +657,10 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node) [this, path, weak_this](auto thumbnail_or_error) { if (thumbnail_or_error.is_error()) { s_thumbnail_cache.set(path, nullptr); - return; + dbgln("Failed to load thumbnail for {}: {}", path, thumbnail_or_error.error()); + } else { + s_thumbnail_cache.set(path, thumbnail_or_error.release_value()); } - s_thumbnail_cache.set(path, thumbnail_or_error.release_value()); // The model was destroyed, no need to update // progress or call any event handlers.