forked from j62/ctbrec
Fix possible NPE in filter function
This commit is contained in:
parent
5164512287
commit
424d046b67
|
@ -13,6 +13,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
@ -786,7 +787,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
|||
}
|
||||
|
||||
private boolean modelPropertiesMatchToken(String token, Model m) throws IOException, ExecutionException {
|
||||
int[] resolution = m.getStreamResolution(true);
|
||||
int[] resolution = Optional.ofNullable(m.getStreamResolution(true)).orElse(new int[2]);
|
||||
String searchText = createSearchText(m);
|
||||
boolean tokensMissing = false;
|
||||
if (token.matches(">\\d+")) {
|
||||
|
@ -817,7 +818,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
|||
for (String tag : m.getTags()) {
|
||||
searchTextBuilder.append(tag).append(' ');
|
||||
}
|
||||
int[] resolution = m.getStreamResolution(true);
|
||||
int[] resolution = Optional.ofNullable(m.getStreamResolution(true)).orElse(new int[2]);
|
||||
searchTextBuilder.append(resolution[1]);
|
||||
return searchTextBuilder.toString().trim();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue