refactor: wrap in an if and log warning in the bad state
This commit is contained in:
parent
812080effc
commit
1855e7e675
|
@ -533,12 +533,16 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||
|
||||
viewModel.setCursor(this, data.first, leftIsRecent);
|
||||
|
||||
int item = restartItem >= 0 ? restartItem : data.second >= 0 ? data.second : 0;
|
||||
if (restartItem >= 0 || data.second >= 0) {
|
||||
int item = restartItem >= 0 ? restartItem : data.second;
|
||||
mediaPager.setCurrentItem(item);
|
||||
|
||||
if (item == 0) {
|
||||
viewPagerListener.onPageSelected(0);
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "one of restartItem "+restartItem+" and data.second "+data.second+" would cause OOB exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue