Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
687bfdce
Commit
687bfdce
authored
8 years ago
by
gnaegi
Browse files
Options
Downloads
Patches
Plain Diff
OO-2085 fix class cast exception in case of transient user object
parent
badc059c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/user/propertyhandlers/DateDisplayPropertyHandler.java
+9
-3
9 additions, 3 deletions
...lat/user/propertyhandlers/DateDisplayPropertyHandler.java
with
9 additions
and
3 deletions
src/main/java/org/olat/user/propertyhandlers/DateDisplayPropertyHandler.java
+
9
−
3
View file @
687bfdce
...
...
@@ -23,6 +23,7 @@ import java.util.Date;
import
java.util.Locale
;
import
java.util.Map
;
import
org.olat.admin.user.imp.TransientIdentity
;
import
org.olat.core.gui.components.form.ValidationError
;
import
org.olat.core.gui.components.form.flexible.FormItem
;
import
org.olat.core.gui.components.form.flexible.FormItemContainer
;
...
...
@@ -73,9 +74,14 @@ public class DateDisplayPropertyHandler extends AbstractUserPropertyHandler {
if
(
DATE_TYPE_CR
.
equals
(
myName
))
return
user
.
getCreationDate
();
if
(
DATE_TYPE_LL
.
equals
(
myName
))
{
Identity
id
=
((
UserImpl
)
user
).
getIdentity
();
if
(
id
!=
null
)
{
return
id
.
getLastLogin
();
if
(
user
instanceof
UserImpl
)
{
Identity
id
=
((
UserImpl
)
user
).
getIdentity
();
if
(
id
!=
null
)
{
return
id
.
getLastLogin
();
}
}
else
if
(
user
instanceof
TransientIdentity
)
{
// anticipated, some kind of preview screen
return
new
Date
(
0
);
}
// huh, we didn't find this identity
log
.
warn
(
"Couldn't find Identity for given User: "
+
user
.
getKey
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment