Catch all errors in loadAd

Issue: #4231

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196180271
This commit is contained in:
andrewlewis 2018-05-10 15:23:31 -07:00 committed by Oliver Woodman
parent d6d7c41065
commit 36d24c7aaa

View File

@ -649,6 +649,7 @@ public final class ImaAdsLoader extends Player.DefaultEventListener implements A
@Override
public void loadAd(String adUriString) {
try {
if (adGroupIndex == C.INDEX_UNSET) {
Log.w(
TAG,
@ -660,7 +661,6 @@ public final class ImaAdsLoader extends Player.DefaultEventListener implements A
if (DEBUG) {
Log.d(TAG, "loadAd in ad group " + adGroupIndex);
}
try {
int adIndexInAdGroup = getAdIndexInAdGroupToLoad(adGroupIndex);
if (adIndexInAdGroup == C.INDEX_UNSET) {
Log.w(TAG, "Unexpected loadAd in an ad group with no remaining unavailable ads");