Wrap mirror links result in try/catch.

This seems to be racy on the receiver side and i have no real way to test it :-/
This commit is contained in:
Adrian Ulrich 2017-07-03 09:21:25 +02:00
parent b07293f968
commit 2666afd234

View File

@ -383,10 +383,14 @@ public class MirrorLinkMediaBrowserService extends MediaBrowserService
List<MediaBrowser.MediaItem> items = null;
if (result != null) {
items = mQueryResult;
if (current == ASYNCTASK_SUCCEEDED) {
result.sendResult(items);
} else {
result.sendResult(Collections.<MediaItem>emptyList());
try {
if (current == ASYNCTASK_SUCCEEDED) {
result.sendResult(items);
} else {
result.sendResult(Collections.<MediaItem>emptyList());
}
} catch (IndexOutOfBoundsException e) {
Log.v("VanillaMusic", "result.send failed: " + e);
}
}
}