Commit ef21ecd7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when project does not contain any map show proper error message

parent d0cabfba
Pipeline #57776 passed with stage
in 18 minutes and 29 seconds
......@@ -4,8 +4,10 @@ minerva (16.2.1) stable; urgency=medium
not be (#1706, #1702)
* Bug fix: searching for non existing chemical caused an error to be thrown
(#1704)
* Bug fix: there was an unexpected error when project did not contain any
map (#1705)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 1 Jun 2022 14:00:00 +0200
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 13 Jun 2022 14:00:00 +0200
minerva (16.2.0) stable; urgency=medium
* Small improvement: cookie policy is supported (#1697, #1700)
......
......@@ -54,8 +54,11 @@ function processUrlGetParams(params) {
var modelId;
if (GuiConnector.getParams["submap"] !== undefined) {
modelId = parseInt(GuiConnector.getParams["submap"]);
} else {
} else if (project.getModels().length > 0) {
modelId = project.getModels()[0].getId()
} else {
return Promise.reject(new ValidationError("You cannot browse the project because it does not contain any map. " +
"Please re-upload the project."));
}
var model = project.getModelById(modelId);
......@@ -482,10 +485,10 @@ function create(params) {
}
return promise;
}).then(function () {
var element = params.getElement();
processUrlGetParams(params);
return processUrlGetParams(params);
}).then(function () {
var element = params.getElement();
params.getElement().innerHTML = "";
createDivStructure(element);
params.setElement(functions.getElementByClassName(element, "minerva-map"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment