From: <hl...@us...> - 2010-05-24 16:54:34
|
Revision: 697 http://treebase.svn.sourceforge.net/treebase/?rev=697&view=rev Author: hlapp Date: 2010-05-24 16:54:27 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix for the null pointer exception in TaxonLabelByLabelComparator. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java 2010-05-01 15:13:17 UTC (rev 696) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java 2010-05-24 16:54:27 UTC (rev 697) @@ -547,7 +547,11 @@ private class TaxonLabelByLabelComparator implements Comparator<TaxonLabel> { public int compare(TaxonLabel a, TaxonLabel b) { - return a.getTaxonLabel().compareTo(b.getTaxonLabel()); + String l1 = (a == null) ? "" : a.getTaxonLabel(); + String l2 = (b == null) ? "" : b.getTaxonLabel(); + if (l1 == null) l1 = ""; + if (l2 == null) l2 = ""; + return l1.compareTo(l2); } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |