From 1081832df03eb6cf0a8d105282560f462bdfdf9b Mon Sep 17 00:00:00 2001 From: The Unnamed Engineer Date: Tue, 10 Jun 2025 13:32:08 -0400 Subject: [PATCH] Handle cases where image has not yet downloaded --- lib/pages/community.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/pages/community.rb b/lib/pages/community.rb index 1b95373..7f2c7c1 100644 --- a/lib/pages/community.rb +++ b/lib/pages/community.rb @@ -161,7 +161,13 @@ class W3DHub flow(width: 1.0, max_width: 1230, height: 200, margin: 8, border_thickness: 1, border_color: lighten(Gosu::Color.new(0xff_252525))) do background 0x44_000000 - image image_path, height: 1.0 + # Ensure the image file exists before trying to load it + if File.exist?(image_path) + image image_path, height: 1.0 + else + logger.warn("W3DHub::Community") { "Image not found in cache: #{image_path}" } + image BLACK_IMAGE, height: 1.0 + end stack(fill: true, height: 1.0, padding: 4, border_thickness_left: 1, border_color_left: lighten(Gosu::Color.new(0xff_252525))) do tagline "#{item.title}", width: 1.0