aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/domain/PodcastChannel.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/domain/PodcastChannel.java b/src/github/daneren2005/dsub/domain/PodcastChannel.java
index 912b0e29..bbfd1f50 100644
--- a/src/github/daneren2005/dsub/domain/PodcastChannel.java
+++ b/src/github/daneren2005/dsub/domain/PodcastChannel.java
@@ -92,8 +92,18 @@ public class PodcastChannel implements Serializable {
@Override
public int compare(PodcastChannel podcast1, PodcastChannel podcast2) {
- String lhs = podcast1.getName().toLowerCase();
- String rhs = podcast2.getName().toLowerCase();
+ String lhs = podcast1.getName();
+ String rhs = podcast2.getName();
+ if(lhs == null && rhs == null) {
+ return 0;
+ } else if(lhs == null) {
+ return 1;
+ } else if(rhs == null) {
+ return -1;
+ }
+
+ lhs = lhs.toLowerCase();
+ rhs = rhs.toLowerCase();
for(String article: ignoredArticles) {
int index = lhs.indexOf(article.toLowerCase() + " ");