Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 650fd11d
authored
Jul 29, 2015
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't fall on NullPointerException if returned EventUser is null.
1 parent
53a1a870
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/UserBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/UserBean.java
View file @
650fd11
...
...
@@ -1143,11 +1143,13 @@ public class UserBean implements UserBeanLocal {
EventUser
eventUser
=
eventUserFacade
.
findByTokenCode
(
code
);
// Event mismatch?
if
(
eventUser
!=
null
)
{
Integer
eventId
=
eventUser
.
getEvent
().
getId
();
Integer
currentEventId
=
eventBean
.
getCurrentEvent
().
getId
();
if
(
eventId
!=
currentEventId
)
{
throw
new
IllegalStateException
(
"Looked up code "
+
code
+
" and got EventUser "
+
eventUser
.
getId
()
+
" from event "
+
eventId
+
" which is not the current event "
+
currentEventId
);
}
}
return
eventUser
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment