|
From: <rv...@us...> - 2012-02-23 15:43:23
|
Revision: 1088
http://treebase.svn.sourceforge.net/treebase/?rev=1088&view=rev
Author: rvos
Date: 2012-02-23 15:43:14 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
Added test to ensure we don't get NullPointerExceptions
Modified Paths:
--------------
trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java
Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java
===================================================================
--- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2012-02-23 15:25:03 UTC (rev 1087)
+++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2012-02-23 15:43:14 UTC (rev 1088)
@@ -175,9 +175,11 @@
// XXX need to filter out orphaned matrices or matrices whose studies are unpublished
Collection<Matrix> orphanedMatrices = new HashSet<Matrix>();
for ( Matrix m : matches ) {
- if ( m.getStudy() == null || (m.getStudy().isPublished() == false) ) {
- orphanedMatrices.add(m);
- }
+ if ( null != m ) {
+ if ( m.getStudy() == null || m.getStudy().isPublished() == false ) {
+ orphanedMatrices.add(m);
+ }
+ }
}
matches.removeAll(orphanedMatrices);
return matches;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|