mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-08-22 01:58:16 +00:00
Improve null checking further in SearchFragment.handleNextItems
This commit is contained in:
parent
30e33d59e8
commit
9ba30887f9
@ -1090,14 +1090,19 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||
showListFooter(false);
|
||||
infoListAdapter.addInfoItemList(result.getItems());
|
||||
|
||||
// nextPage should not be null here because it refers to the page
|
||||
// which results are handled here, but we check it anyway
|
||||
if (!result.getErrors().isEmpty() && nextPage != null) {
|
||||
showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED,
|
||||
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
|
||||
+ "pageIds: " + nextPage.getIds() + ", "
|
||||
+ "pageCookies: " + nextPage.getCookies(),
|
||||
serviceId));
|
||||
if (!result.getErrors().isEmpty()) {
|
||||
// nextPage should be non-null at this point, because it refers to the page
|
||||
// whose results are handled here, but let's check it anyway
|
||||
if (nextPage == null) {
|
||||
showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED,
|
||||
"\"" + searchString + "\" → nextPage == null", serviceId));
|
||||
} else {
|
||||
showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED,
|
||||
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
|
||||
+ "pageIds: " + nextPage.getIds() + ", "
|
||||
+ "pageCookies: " + nextPage.getCookies(),
|
||||
serviceId));
|
||||
}
|
||||
}
|
||||
|
||||
// keep the reassignment of nextPage after the error handling to ensure that nextPage
|
||||
|
Loading…
x
Reference in New Issue
Block a user