Improved spine stopListeningTo() - In certain cases (e. g. http://localhost:3000/#knowledge_base/1/locale/en-us/edit just change the title and submit) a Uncaught TypeError: Cannot read property 'obj' of undefined
is raised. The reason is that listeningToOnce is an empty array.
This commit is contained in:
parent
dd1a6c30fc
commit
049adbe469
1 changed files with 6 additions and 0 deletions
|
@ -60,6 +60,12 @@ Events =
|
||||||
for ev in events
|
for ev in events
|
||||||
for idx in [listeningTo.length-1..0]
|
for idx in [listeningTo.length-1..0]
|
||||||
lt = listeningTo[idx]
|
lt = listeningTo[idx]
|
||||||
|
# 2019-05-20 (me): check if listeningTo has content
|
||||||
|
# in certain cases (e. g. http://localhost:3000/#knowledge_base/1/locale/en-us/edit just
|
||||||
|
# change the title and submit) a `Uncaught TypeError: Cannot read property 'obj' of undefined`
|
||||||
|
# is raised. The reason is that listeningToOnce is an empty array.
|
||||||
|
continue if !lt
|
||||||
|
# /2019-05-20 (me)
|
||||||
continue unless lt.obj is obj
|
continue unless lt.obj is obj
|
||||||
continue if callback and lt.callback isnt callback
|
continue if callback and lt.callback isnt callback
|
||||||
if (not ev) or (ev is lt.ev)
|
if (not ev) or (ev is lt.ev)
|
||||||
|
|
Loading…
Reference in a new issue