mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-12 22:38:11 -05:00
* defensive programming for old json data
This commit is contained in:
parent
d421a0f55f
commit
f7a99a2ede
@ -2,6 +2,7 @@ package net.sourceforge.filebot.web;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Movie extends SearchResult {
|
public class Movie extends SearchResult {
|
||||||
@ -43,6 +44,10 @@ public class Movie extends SearchResult {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getEffectiveNames() {
|
public List<String> getEffectiveNames() {
|
||||||
|
if (aliasNames == null || aliasNames.length == 0) {
|
||||||
|
return Collections.singletonList(toString(name, year));
|
||||||
|
}
|
||||||
|
|
||||||
List<String> names = new ArrayList<String>(1 + aliasNames.length);
|
List<String> names = new ArrayList<String>(1 + aliasNames.length);
|
||||||
names.add(toString(name, year));
|
names.add(toString(name, year));
|
||||||
for (String alias : aliasNames) {
|
for (String alias : aliasNames) {
|
||||||
|
@ -2,6 +2,7 @@ package net.sourceforge.filebot.web;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.AbstractList;
|
import java.util.AbstractList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class SearchResult implements Serializable {
|
public abstract class SearchResult implements Serializable {
|
||||||
@ -27,6 +28,10 @@ public abstract class SearchResult implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getEffectiveNames() {
|
public List<String> getEffectiveNames() {
|
||||||
|
if (aliasNames == null || aliasNames.length == 0) {
|
||||||
|
return Collections.singletonList(name);
|
||||||
|
}
|
||||||
|
|
||||||
return new AbstractList<String>() {
|
return new AbstractList<String>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user