Skip to content

Commit

Permalink
Fix camera stream edge case error when no image is received (#107)
Browse files Browse the repository at this point in the history
After disconnecting from network tables, if no image was received from a
camera stream, there would be an error due to trying to display an image
from an empty cache. This is a fix for it.
  • Loading branch information
Gold872 authored Oct 6, 2024
1 parent 047d590 commit 0d609bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/widgets/nt_widgets/multi-topic/camera_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ class CameraStreamWidget extends NTWidget {
return Stack(
fit: StackFit.expand,
children: [
if (model.mjpegStream != null || model.lastDisplayedImage != null)
if (model.mjpegStream?.previousImage != null ||
model.lastDisplayedImage != null)
Opacity(
opacity: 0.35,
child: Image(
Expand Down

0 comments on commit 0d609bc

Please sign in to comment.