Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 6f9e0e8

Browse files
committed
fix(images): validate image availability before fading-in
[skip ci]
1 parent c494535 commit 6f9e0e8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/modules/nzbget/routes/queue.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ class _State extends State<NZBGetQueue>
5858
});
5959

6060
Future<void> _fetchWithoutMessage() async {
61-
_fetch().then((_) => {if (mounted) setState(() {})}).catchError((error) {
61+
_fetch().then((_) {
62+
if (mounted) setState(() {});
63+
}).catchError((error) {
6264
_queue = null;
6365
});
6466
}
@@ -76,7 +78,7 @@ class _State extends State<NZBGetQueue>
7678
}).catchError((error) {
7779
_queue = null;
7880
_setError(true);
79-
return Future.error(error);
81+
throw error;
8082
});
8183
}
8284

lib/widgets/ui/block/block.dart

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ class LunaBlock extends StatelessWidget {
164164
}
165165

166166
Widget _fadeInBackground(BuildContext context, double _height) {
167+
if (backgroundUrl == null) return const SizedBox();
168+
167169
final _percent = LunaSeaDatabase.THEME_IMAGE_BACKGROUND_OPACITY.read();
168170
if (_percent == 0) return const SizedBox(height: 0, width: 0);
169171

lib/widgets/ui/block/grid_block.dart

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class LunaGridBlock extends StatelessWidget {
8585
}
8686

8787
Widget _fadeInBackground(BuildContext context) {
88+
if (backgroundUrl == null) return const SizedBox();
89+
8890
final _percent = LunaSeaDatabase.THEME_IMAGE_BACKGROUND_OPACITY.read();
8991
if (_percent == 0) return const SizedBox(height: 0, width: 0);
9092

0 commit comments

Comments
 (0)