summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-04-02 09:29:06 (EDT)
committer Sven Rottstock2013-04-02 09:29:06 (EDT)
commit8e5681ea2cf49950a5e176ecb5a1a58bb30b979b (patch)
treef8253645ba8d1937a25d1b663a229b38c26e650e
parent17d903149a24d97d90658a2ac3c6f720f248b6bc (diff)
downloadorg.eclipse.stardust.ui.web-8e5681ea2cf49950a5e176ecb5a1a58bb30b979b.zip
org.eclipse.stardust.ui.web-8e5681ea2cf49950a5e176ecb5a1a58bb30b979b.tar.gz
org.eclipse.stardust.ui.web-8e5681ea2cf49950a5e176ecb5a1a58bb30b979b.tar.bz2
Jira-ID: CRNT-28609
Added null check for user in UserUtils.loadDisplayPreferenceForUser(user) Added null check for user in LogTableEntry initUser git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@64035 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/LogTableEntry.java2
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java23
2 files changed, 14 insertions, 11 deletions
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/LogTableEntry.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/LogTableEntry.java
index 56d51eb..ea84914 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/LogTableEntry.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/LogTableEntry.java
@@ -91,7 +91,7 @@ public class LogTableEntry extends DefaultRowModel
linkDisabled = true;
}
User loggedInUser = SessionContext.findSessionContext().getUser();
- if (!user.getAccount().equals(loggedInUser.getAccount()))
+ if ((null != user) && !user.getAccount().equals(loggedInUser.getAccount()))
{
UserUtils.loadDisplayPreferenceForUser(user);
accountName = UserUtils.getUserDisplayLabel(user);
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
index f8ae617..aacf55d 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
@@ -223,17 +223,20 @@ public class UserUtils
*/
public static void loadDisplayPreferenceForUser(User user)
{
- Serializable displayNameFormat = null;
- QueryService queryService = SessionContext.findSessionContext().getServiceFactory().getQueryService();
- List<Preferences> prefs = queryService.getAllPreferences(PreferenceQuery.findPreferencesForUsers(user.getRealm()
- .getId(), user.getId(), UserPreferencesEntries.M_ADMIN_PORTAL, PREFERENCES_ID));
- for (Preferences userPref : prefs)
- {
- displayNameFormat = userPref.getPreferences().get(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID);
- }
- if (displayNameFormat != null)
+ if (null != user)
{
- user.setProperty(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID, displayNameFormat);
+ Serializable displayNameFormat = null;
+ QueryService queryService = SessionContext.findSessionContext().getServiceFactory().getQueryService();
+ List<Preferences> prefs = queryService.getAllPreferences(PreferenceQuery.findPreferencesForUsers(user
+ .getRealm().getId(), user.getId(), UserPreferencesEntries.M_ADMIN_PORTAL, PREFERENCES_ID));
+ for (Preferences userPref : prefs)
+ {
+ displayNameFormat = userPref.getPreferences().get(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID);
+ }
+ if (displayNameFormat != null)
+ {
+ user.setProperty(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID, displayNameFormat);
+ }
}
}