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
7a098782
Commit
7a098782
authored
12 years ago
by
Julian Hochstetter
Browse files
Options
Downloads
Patches
Plain Diff
check if logged_in view has visitedSessions before use them, which
caused in past server errors
parent
858343ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+12
-6
12 additions, 6 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
with
12 additions
and
6 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+
12
−
6
View file @
7a098782
...
...
@@ -616,9 +616,12 @@ public class CouchDBDao implements IDatabaseDao {
if
(
results
.
getJSONArray
(
"rows"
).
optJSONObject
(
0
)
!=
null
)
{
JSONObject
json
=
results
.
getJSONArray
(
"rows"
).
optJSONObject
(
0
).
optJSONObject
(
"value"
);
loggedIn
=
(
LoggedIn
)
JSONObject
.
toBean
(
json
,
LoggedIn
.
class
);
Collection
<
VisitedSession
>
visitedSessions
=
JSONArray
.
toCollection
(
json
.
getJSONArray
(
"visitedSessions"
),
VisitedSession
.
class
);
loggedIn
.
setVisitedSessions
(
new
ArrayList
<
VisitedSession
>(
visitedSessions
));
JSONArray
vs
=
json
.
optJSONArray
(
"visitedSessions"
);
if
(
vs
!=
null
)
{
Collection
<
VisitedSession
>
visitedSessions
=
JSONArray
.
toCollection
(
vs
,
VisitedSession
.
class
);
loggedIn
.
setVisitedSessions
(
new
ArrayList
<
VisitedSession
>(
visitedSessions
));
}
}
loggedIn
.
setUser
(
user
.
getUsername
());
...
...
@@ -640,9 +643,12 @@ public class CouchDBDao implements IDatabaseDao {
this
.
getDatabase
().
saveDocument
(
doc
);
LoggedIn
l
=
(
LoggedIn
)
JSONObject
.
toBean
(
doc
.
getJSONObject
(),
LoggedIn
.
class
);
Collection
<
VisitedSession
>
visitedSessions
=
JSONArray
.
toCollection
(
doc
.
getJSONObject
().
getJSONArray
(
"visitedSessions"
),
VisitedSession
.
class
);
l
.
setVisitedSessions
(
new
ArrayList
<
VisitedSession
>(
visitedSessions
));
JSONArray
vs
=
doc
.
getJSONObject
().
optJSONArray
(
"visitedSessions"
);
if
(
vs
!=
null
)
{
Collection
<
VisitedSession
>
visitedSessions
=
JSONArray
.
toCollection
(
vs
,
VisitedSession
.
class
);
l
.
setVisitedSessions
(
new
ArrayList
<
VisitedSession
>(
visitedSessions
));
}
return
l
;
}
catch
(
UnsupportedEncodingException
e
)
{
return
null
;
...
...
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