Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
d255c8c9
Commit
d255c8c9
authored
9 years ago
by
Andreas Gärtner
Browse files
Options
Downloads
Patches
Plain Diff
Prevent NullPointerException when no feedback is present in storage
parent
7207bad9
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/FeedbackStorage.java
+9
-7
9 additions, 7 deletions
src/main/java/de/thm/arsnova/FeedbackStorage.java
with
9 additions
and
7 deletions
src/main/java/de/thm/arsnova/FeedbackStorage.java
+
9
−
7
View file @
d255c8c9
...
...
@@ -137,13 +137,15 @@ public class FeedbackStorage {
final
Map
<
User
,
FeedbackStorageObject
>
sessionFeedbacks
=
data
.
get
(
session
);
final
List
<
User
>
affectedUsers
=
new
ArrayList
<
User
>();
for
(
final
Map
.
Entry
<
User
,
FeedbackStorageObject
>
entry
:
sessionFeedbacks
.
entrySet
())
{
final
User
user
=
entry
.
getKey
();
final
FeedbackStorageObject
feedback
=
entry
.
getValue
();
final
boolean
timeIsUp
=
feedback
.
getTimestamp
().
before
(
maxAllowedTime
);
if
(
timeIsUp
)
{
sessionFeedbacks
.
remove
(
user
);
affectedUsers
.
add
(
user
);
if
(
sessionFeedbacks
!=
null
)
{
for
(
final
Map
.
Entry
<
User
,
FeedbackStorageObject
>
entry
:
sessionFeedbacks
.
entrySet
())
{
final
User
user
=
entry
.
getKey
();
final
FeedbackStorageObject
feedback
=
entry
.
getValue
();
final
boolean
timeIsUp
=
feedback
.
getTimestamp
().
before
(
maxAllowedTime
);
if
(
timeIsUp
)
{
sessionFeedbacks
.
remove
(
user
);
affectedUsers
.
add
(
user
);
}
}
}
return
affectedUsers
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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