← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12852: Null check in module

 

------------------------------------------------------------
revno: 12852
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-01 12:46:25 +0100
message:
  Null check in module
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java	2013-10-09 17:16:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java	2013-11-01 11:46:25 +0000
@@ -82,8 +82,10 @@
 
     public static Module getModule( App app )
     {
+        boolean hasIcon = app.getIcons() != null && app.getIcons().getIcon48() != null;
+        
         String defaultAction = app.getLaunchUrl();
-        String icon = app.getFolderName() + File.separator + app.getIcons().getIcon48();
+        String icon = hasIcon ? app.getFolderName() + File.separator + app.getIcons().getIcon48() : null;
         String description = TextUtils.subString( app.getDescription(), 0, 80 );
         
         Module module = new Module( app.getName(), app.getName(), defaultAction );