mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-30 23:03:00 +00:00 
			
		
		
		
	Merge pull request #12455 from TobiGr/nextPage-nullable
This commit is contained in:
		| @@ -1089,15 +1089,25 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I | |||||||
|     public void handleNextItems(final ListExtractor.InfoItemsPage<?> result) { |     public void handleNextItems(final ListExtractor.InfoItemsPage<?> result) { | ||||||
|         showListFooter(false); |         showListFooter(false); | ||||||
|         infoListAdapter.addInfoItemList(result.getItems()); |         infoListAdapter.addInfoItemList(result.getItems()); | ||||||
|         nextPage = result.getNextPage(); |  | ||||||
|  |  | ||||||
|         if (!result.getErrors().isEmpty() && nextPage != null) { |         if (!result.getErrors().isEmpty()) { | ||||||
|             showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED, |             // nextPage should be non-null at this point, because it refers to the page | ||||||
|                     "\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", " |             // whose results are handled here, but let's check it anyway | ||||||
|                             + "pageIds: " + nextPage.getIds() + ", " |             if (nextPage == null) { | ||||||
|                             + "pageCookies: " + nextPage.getCookies(), |                 showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED, | ||||||
|                     serviceId)); |                         "\"" + 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 | ||||||
|  |         // still holds the correct value during the error handling | ||||||
|  |         nextPage = result.getNextPage(); | ||||||
|         super.handleNextItems(result); |         super.handleNextItems(result); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox