Fixed issue #1841: Taskbar item race condition causes JS exception.

This commit is contained in:
Thorsten Eckel 2018-02-19 18:00:45 +01:00
parent 313e0c3ee9
commit f25815b31d

View file

@ -417,6 +417,15 @@ class Model extends Module
# ID change, need to do some shifting
if atts.id and @id isnt atts.id
@changeID(atts.id)
# temporary debugging of a possible race condition
if !@constructor.irecords[@id]
model = @constructor.className
atts_json = JSON.stringify(atts)
console.notice "Can't refresh not exisint %s instance with ID %s and attributes %s. Possible race condition?", model, @id, atts_json
# prevent exception
return
# go to the source and load attributes
@constructor.irecords[@id].load(atts)
@trigger('refresh', this)