Prevent NPE if media was not found
This commit is contained in:
parent
07d378cffd
commit
2d2cf2f933
|
@ -134,12 +134,16 @@ public class DownloadLogAdapter extends BaseAdapter {
|
||||||
}
|
}
|
||||||
} else if(holder.typeId == FeedMedia.FEEDFILETYPE_FEEDMEDIA) {
|
} else if(holder.typeId == FeedMedia.FEEDFILETYPE_FEEDMEDIA) {
|
||||||
FeedMedia media = DBReader.getFeedMedia(holder.id);
|
FeedMedia media = DBReader.getFeedMedia(holder.id);
|
||||||
try {
|
if (media != null) {
|
||||||
DBTasks.downloadFeedItems(context, media.getItem());
|
try {
|
||||||
Toast.makeText(context, R.string.status_downloading_label, Toast.LENGTH_SHORT).show();
|
DBTasks.downloadFeedItems(context, media.getItem());
|
||||||
} catch (DownloadRequestException e) {
|
Toast.makeText(context, R.string.status_downloading_label, Toast.LENGTH_SHORT).show();
|
||||||
e.printStackTrace();
|
} catch (DownloadRequestException e) {
|
||||||
DownloadRequestErrorDialogCreator.newRequestErrorDialog(context, e.getMessage());
|
e.printStackTrace();
|
||||||
|
DownloadRequestErrorDialogCreator.newRequestErrorDialog(context, e.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.wtf(TAG, "Could not find media for id: " + holder.id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.wtf(TAG, "Unexpected type id: " + holder.typeId);
|
Log.wtf(TAG, "Unexpected type id: " + holder.typeId);
|
||||||
|
|
Loading…
Reference in New Issue