[banshee/better-now-playing] [NowPlaying] Fix potential nre in NowPlayingContents
- From: Alex Launi <alexlauni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/better-now-playing] [NowPlaying] Fix potential nre in NowPlayingContents
- Date: Fri, 25 Jun 2010 03:02:46 +0000 (UTC)
commit 589b3203d1aab4bec15a2b514916c4851430a74e
Author: Alex Launi <alex launi gmail com>
Date: Thu Jun 24 20:15:47 2010 -0400
[NowPlaying] Fix potential nre in NowPlayingContents
ivideo_display was being checked for null, and then used outside
of the check. Moved code using ivideo_display to ensure it is
non-null.
.../Banshee.Lastfm.Recommendations/ContextPage.cs | 1 -
.../Banshee.NowPlaying/NowPlayingContents.cs | 8 +++++---
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/ContextPage.cs b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/ContextPage.cs
index a359085..0774ef3 100644
--- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/ContextPage.cs
+++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/ContextPage.cs
@@ -66,6 +66,5 @@ namespace Banshee.Lastfm.Recommendations
return TrackMediaAttributes.Music;
}
}
-
}
}
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
index 8716ff8..4431d4d 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
@@ -137,10 +137,12 @@ namespace Banshee.NowPlaying
private void CheckIdle ()
{
IVideoDisplay ivideo_display = video_display as IVideoDisplay;
- if (ivideo_display != null) {
- video_display.Visible = !ivideo_display.IsIdle;
+ if (ivideo_display == null) {
+ (substitute_audio_display ?? track_info_display).Visible = true;
+ return;
}
-
+
+ video_display.Visible = !ivideo_display.IsIdle;
track_info_display.Visible = false;
(substitute_audio_display ?? track_info_display).Visible = ivideo_display.IsIdle;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]