* fix potential NPE
This commit is contained in:
parent
e8749aa435
commit
d1bead2d64
|
@ -118,11 +118,16 @@ public class EpisodeMatcher extends Matcher<File, Object> {
|
|||
|
||||
// check episode sequence integrity
|
||||
Integer seqIndex = null;
|
||||
for (Episode ep : episodes) {
|
||||
if (seqIndex != null && !ep.getEpisode().equals(seqIndex + 1))
|
||||
for (Episode it : episodes) {
|
||||
// any illegal episode object breaks the chain
|
||||
if (it == null || it.getEpisode() == null || it.getSpecial() != null)
|
||||
return false;
|
||||
|
||||
seqIndex = ep.getEpisode();
|
||||
// non-sequential episode index breaks the chain
|
||||
if (seqIndex != null && !it.getEpisode().equals(seqIndex + 1))
|
||||
return false;
|
||||
|
||||
seqIndex = it.getEpisode();
|
||||
}
|
||||
|
||||
// check drill-down integrity
|
||||
|
|
|
@ -73,13 +73,13 @@ public class AnidbClient extends AbstractEpisodeListProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SearchResult> search(String query, final Locale locale) throws Exception {
|
||||
public List<SearchResult> search(String query, Locale locale) throws Exception {
|
||||
// bypass automatic caching since search is based on locally cached data anyway
|
||||
return fetchSearchResult(query, locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchResult> fetchSearchResult(String query, final Locale locale) throws Exception {
|
||||
public List<SearchResult> fetchSearchResult(String query, Locale locale) throws Exception {
|
||||
LocalSearch<SearchResult> index = new LocalSearch<SearchResult>(getAnimeTitles()) {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue