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,15 +1090,20 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
showListFooter(false);
|
showListFooter(false);
|
||||||
infoListAdapter.addInfoItemList(result.getItems());
|
infoListAdapter.addInfoItemList(result.getItems());
|
||||||
|
|
||||||
// nextPage should not be null here because it refers to the page
|
if (!result.getErrors().isEmpty()) {
|
||||||
// which results are handled here, but we check it anyway
|
// nextPage should be non-null at this point, because it refers to the page
|
||||||
if (!result.getErrors().isEmpty() && nextPage != null) {
|
// 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,
|
showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED,
|
||||||
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
|
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
|
||||||
+ "pageIds: " + nextPage.getIds() + ", "
|
+ "pageIds: " + nextPage.getIds() + ", "
|
||||||
+ "pageCookies: " + nextPage.getCookies(),
|
+ "pageCookies: " + nextPage.getCookies(),
|
||||||
serviceId));
|
serviceId));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// keep the reassignment of nextPage after the error handling to ensure that nextPage
|
// keep the reassignment of nextPage after the error handling to ensure that nextPage
|
||||||
// still holds the correct value during the error handling
|
// still holds the correct value during the error handling
|
||||||
|
Loading…
x
Reference in New Issue
Block a user