1
0
Fork 0

issue #1402: Query export in web frontend not working

This commit is contained in:
Jan Steemann 2015-07-14 23:44:26 +02:00
parent 289cdfcd43
commit 8dbd76a97e
2 changed files with 8 additions and 3 deletions

View File

@ -232,7 +232,12 @@ controller.get("/query/download/:user", function(req, res) {
res.set("Content-Type", "application/json");
res.set("Content-Disposition", "attachment; filename=queries.json");
res.json(result.userData.queries);
if (result === null || result === undefined) {
res.json([]);
}
else {
res.json(result.userData.queries || []);
}
}).summary("Download all user queries")
.notes("This function downloads all user queries from the given user");

View File

@ -347,9 +347,9 @@
$.ajax("whoAmI?_=" + Date.now(), {async:false}).done(
function(data) {
name = data.name;
name = data.user;
if (name === null) {
if (name === null || name === false) {
name = "root";
}