Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
b722d7fb
Commit
b722d7fb
authored
Mar 30, 2020
by
Piotr Gawron
Browse files
handle cases when plugin data is not loaded yet
parent
1601acaa
Pipeline
#23874
canceled with stage
in 1 minute and 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
b722d7fb
...
...
@@ -11,6 +11,8 @@ minerva (14.0.11) stable; urgency=medium
CellDesigner
file
minerva
(#
1203
)
*
Bug
fix
:
author
list
inproperly
presented
author
data
when
some
fields
were
missing
(#
1201
)
*
Bug
fix
:
refreshing
minerva
page
with
more
than
one
plugin
opened
might
led
to
an
error
due
to
race
condition
(#
1197
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Mon
,
30
Mar
2020
10
:
00
:
00
+
0200
...
...
frontend-js/src/main/js/plugin/Plugin.js
View file @
b722d7fb
...
...
@@ -80,7 +80,7 @@ Plugin.prototype.setLoadedPluginData = function (loadedPluginData) {
/**
*
* @returns {UserPluginObject}
* @returns {
?null|
UserPluginObject}
*/
Plugin
.
prototype
.
getLoadedPluginData
=
function
()
{
return
this
.
_loadedPluginData
;
...
...
@@ -189,11 +189,15 @@ Plugin.prototype.load = function () {
Plugin
.
prototype
.
getMinWidth
=
function
()
{
var
value
;
var
data
=
this
.
getLoadedPluginData
();
if
(
data
.
minWidth
!==
undefined
)
{
if
(
typeof
data
.
minWidth
===
"
function
"
)
{
value
=
parseInt
(
data
.
minWidth
());
}
else
{
value
=
parseInt
(
data
.
minWidth
);
if
(
data
===
undefined
||
data
===
null
)
{
//this can happen when plugin is added to list of plugins but data was not loaded yet
logger
.
warn
(
"
[
"
+
this
.
getName
()
+
"
] Plugin data not available.
"
);
}
else
{
if
(
data
.
minWidth
!==
undefined
)
{
if
(
typeof
data
.
minWidth
===
"
function
"
)
{
value
=
parseInt
(
data
.
minWidth
());
}
else
{
value
=
parseInt
(
data
.
minWidth
);
}
}
}
return
value
;
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment