dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28982
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14567: Minor
------------------------------------------------------------
revno: 14567
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-31 14:46:43 +0200
message:
Minor
modified:
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/menu/action/GetModulesAction.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/menu/action/GetModulesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/menu/action/GetModulesAction.java 2014-03-26 22:35:09 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/menu/action/GetModulesAction.java 2014-03-31 12:46:43 +0000
@@ -33,6 +33,7 @@
import java.util.List;
import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.User;
import org.hisp.dhis.webportal.module.Module;
import org.hisp.dhis.webportal.module.ModuleManager;
import org.springframework.beans.factory.annotation.Autowired;
@@ -64,10 +65,12 @@
{
modules = manager.getAccessibleMenuModulesAndApps();
- final List<String> userApps = currentUserService.getCurrentUser().getApps();
+ User user = currentUserService.getCurrentUser();
- if ( userApps != null && !userApps.isEmpty() )
+ if ( user != null && user.getApps() != null && !user.getApps().isEmpty() )
{
+ final List<String> userApps = user.getApps();
+
Collections.sort( modules, new Comparator<Module>()
{
@Override