From eacbaa3680bf4b72bb398a1459c9fc68a649f582 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sat, 18 Aug 2018 14:20:36 +0200 Subject: [PATCH] fix exception on nothing found --- .../schabi/newpipe/fragments/list/search/SearchFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 2a564f0a8..a699e28bc 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -836,7 +836,10 @@ public class SearchFragment @Override public void handleResult(@NonNull SearchInfo result) { - if (!result.getErrors().isEmpty()) { + final List exceptions = result.getErrors(); + if (!exceptions.isEmpty() + && !(exceptions.size() == 1 + && exceptions.get(0) instanceof SearchExtractor.NothingFoundException)){ showSnackBarError(result.getErrors(), UserAction.SEARCHED, NewPipe.getNameOfService(serviceId), searchString, 0); }