ID:2026758
 
Resolved
A sanity check has been added to prevent client crashes when flicking an invalid icon.
BYOND Version:510.1321
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 47.0.2526.111
Applies to:Webclient
Status: Resolved (510.1323)

This issue has been resolved.
Descriptive Problem Summary:

TypeError: Cannot read property '0' of undefined
at IconState.dart.IconState.IconAt$2 (http://localhost:5000/res/webclient.dart.js:8831:26)
at IconInfo.dart.IconInfo.IconAt$4 (http://localhost:5000/res/webclient.dart.js:8955:27)
at Appearance.dart.Appearance.Fill$5 (http://localhost:5000/res/webclient.dart.js:3022:35)
at Appearance.dart.Appearance.Fill$5 (http://localhost:5000/res/webclient.dart.js:3016:38)
at AtomInfo.dart.AtomInfo.MapIcons$2 (http://localhost:5000/res/webclient.dart.js:3886:11)
at AtomInfo.dart.AtomInfo.MapIcons$1 (http://localhost:5000/res/webclient.dart.js:3980:19)
at AtomInfo.dart.AtomInfo.RefreshIcons$0 (http://localhost:5000/res/webclient.dart.js:3794:31)
at ByondMap.dart.ByondMap.copyMapAtoms$3 (http://localhost:5000/res/webclient.dart.js:9977:14)
at ByondMap.dart.ByondMap.doAtoms$2 (http://localhost:5000/res/webclient.dart.js:9901:20)
at MapInfo.dart.MapInfo.drawMap$0 (http://localhost:5000/res/webclient.dart.js:12405:12)


The above crash will sometimes freeze the screens of clients in range of a specific mob when it calls the following code:

        Use(mob/caster, mob/target)
caster.locked++
caster.immortal = 2

sleep(5)

flick("disappear", caster)
sleep(1)
caster.icon_state = "null"
sleep(10)
caster.loc = null

sleep(rand(10, 50))

var/list/turfs = list()
for(var/turf/T in orange(5, target))
var/pass = T.density
if(!pass)
for(var/atom/A in T)
if(A.density)
pass = 1
break
if(!pass) turfs.Add(T)

var/turf/T = pick(turfs)
caster.loc = T
flick("appear", caster)
sleep(1)
caster.icon_state = "movement"

sleep(12)
caster.locked--
caster.immortal = 0



All I know is that the problem resides within the above code. If you need any more info, let me know.
Any info on this?
This is on my list to look at but I haven't gotten to it yet. I'm working on webclient stuff but at the moment it's all 510 features.
Lummox JR resolved issue with message:
A sanity check has been added to prevent client crashes when flicking an invalid icon.
Descriptive Problem Summary:

The following crash has occured:
Uncaught Uncaught Error: NullError: Cannot call "length" on null
Stack Trace:
TypeError: Cannot read property 'length' of undefined
at JSArray.dart.JSArray.get$first (http://74.91.127.229:5000/res/webclient.dart.js:18986:19)
at IconState.dart.IconState.IconAt$2 (http://74.91.127.229:5000/res/webclient.dart.js:8821:34)
at IconInfo.dart.IconInfo.IconAt$4 (http://74.91.127.229:5000/res/webclient.dart.js:8955:27)
at Appearance.dart.Appearance.Fill$5 (http://74.91.127.229:5000/res/webclient.dart.js:3022:35)
at Appearance.dart.Appearance.Fill$5 (http://74.91.127.229:5000/res/webclient.dart.js:3016:38)
at AtomInfo.dart.AtomInfo.MapIcons$2 (http://74.91.127.229:5000/res/webclient.dart.js:3886:11)
at AtomInfo.dart.AtomInfo.MapIcons$1 (http://74.91.127.229:5000/res/webclient.dart.js:3980:19)
at AtomInfo.dart.AtomInfo.RefreshIcons$0 (http://74.91.127.229:5000/res/webclient.dart.js:3794:31)
at ByondMap.dart.ByondMap.copyMapAtoms$3 (http://74.91.127.229:5000/res/webclient.dart.js:9977:14)
at ByondMap.dart.ByondMap.doAtoms$2 (http://74.91.127.229:5000/res/webclient.dart.js:9901:20)


We're running 510.1320 in this server, but I'm posting this here anyway. We'll update to 1322 and report back if the issue persists.
In response to Doohl
Just tested on 510.1322, and this issue still happens.
In response to Doohl
I reattached this because it turns out to be the same issue.