File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
app/src/main/java/org/schabi/newpipe/fragments/list/search Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1089,15 +1089,20 @@ private void handleSearchSuggestion() {
10891089 public void handleNextItems (final ListExtractor .InfoItemsPage <?> result ) {
10901090 showListFooter (false );
10911091 infoListAdapter .addInfoItemList (result .getItems ());
1092- nextPage = result .getNextPage ();
10931092
1093+ // nextPage should not be null here because it refers to the page
1094+ // which results are handled here, but we check it anyway
10941095 if (!result .getErrors ().isEmpty () && nextPage != null ) {
10951096 showSnackBarError (new ErrorInfo (result .getErrors (), UserAction .SEARCHED ,
10961097 "\" " + searchString + "\" → pageUrl: " + nextPage .getUrl () + ", "
10971098 + "pageIds: " + nextPage .getIds () + ", "
10981099 + "pageCookies: " + nextPage .getCookies (),
10991100 serviceId ));
11001101 }
1102+
1103+ // keep the reassignment of nextPage after the error handling to ensure that nextPage
1104+ // still holds the correct value during the error handling
1105+ nextPage = result .getNextPage ();
11011106 super .handleNextItems (result );
11021107 }
11031108
You can’t perform that action at this time.
0 commit comments