[banshee] TrackActions: prefer InvalidCastException over NREs
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] TrackActions: prefer InvalidCastException over NREs
- Date: Tue, 20 May 2014 11:29:24 +0000 (UTC)
commit 43b2e0ccc75d94b983b6a6467be06e49ce14c472
Author: Andrés G. Aragoneses <knocte gmail com>
Date: Tue May 20 13:29:12 2014 +0200
TrackActions: prefer InvalidCastException over NREs
Replace dynamic casts with static casts in a couple of places where
the null-check is not performed before dereferencing the variable.
.../Banshee.Gui/TrackActions.cs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
b/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
index ca0a350..c4ad257 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
@@ -428,7 +428,7 @@ namespace Banshee.Gui
}
// TODO find just the menu that was activated instead of modifying all proxies
- foreach (Widget proxy_widget in (o as Gtk.Action).Proxies) {
+ foreach (Widget proxy_widget in ((Gtk.Action)o).Proxies) {
MenuItem menu = proxy_widget as MenuItem;
if (menu == null)
continue;
@@ -563,7 +563,7 @@ namespace Banshee.Gui
private void OnRateTracks (object o, EventArgs args)
{
ThreadAssist.SpawnFromMain (delegate {
- (ActiveSource as DatabaseSource).RateSelectedTracks (rating_proxy.LastRating);
+ ((DatabaseSource)ActiveSource).RateSelectedTracks (rating_proxy.LastRating);
});
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]