Commit 43b2e0cc authored by Andrés G. Aragoneses's avatar Andrés G. Aragoneses

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.
parent 7c42e7a8
......@@ -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);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment