Fixed issue #1841: Taskbar item race condition causes JS exception.
This commit is contained in:
parent
313e0c3ee9
commit
f25815b31d
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue