Fixed crash when route is added.

This commit is contained in:
Felix Ableitner 2014-05-10 12:33:00 +02:00
parent 263028c42a
commit 44064c25de

View file

@ -133,8 +133,10 @@ public class MediaRouterPlayService extends Service {
public void onRouteAdded(MediaRouter router, RouteInfo route) { public void onRouteAdded(MediaRouter router, RouteInfo route) {
if (route.getId().equals(mCurrentRoute.getId())) { if (route.getId().equals(mCurrentRoute.getId())) {
selectRoute(route); selectRoute(route);
new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack) if (mCurrentTrack >= 0 && mCurrentTrack < mPlaylist.size()) {
.getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class)); new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack)
.getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class));
}
} }
} }
}; };