From 649a9f1e4d306afe3bf9bd703b093923d54eca99 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 25 Oct 2012 19:28:30 +0000 Subject: [PATCH] * added null checks and make sure to verify serienjunkies data --- .../net/sourceforge/filebot/similarity/EpisodeMetrics.java | 4 ++++ source/net/sourceforge/filebot/web/SerienjunkiesClient.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java index 469ea20a..1e9f03a5 100644 --- a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java +++ b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java @@ -354,6 +354,10 @@ public enum EpisodeMetrics implements SimilarityMetric { protected static String normalizeObject(Object object) { + if (object == null) { + return ""; + } + String result = transformCache.get(object); if (result != null) { return result; diff --git a/source/net/sourceforge/filebot/web/SerienjunkiesClient.java b/source/net/sourceforge/filebot/web/SerienjunkiesClient.java index 2f75c356..02e54873 100644 --- a/source/net/sourceforge/filebot/web/SerienjunkiesClient.java +++ b/source/net/sourceforge/filebot/web/SerienjunkiesClient.java @@ -138,6 +138,11 @@ public class SerienjunkiesClient extends AbstractEpisodeListProvider { title = german; } + // enforce sanity + if (title == null) { + title = ""; + } + episodes.add(new Episode(seriesName, series.getStartDate(), season, episode, title, i + 1, null, airdate)); }