ensuure we don't store 'null' in the name->guid cache object

(an alternative to #572)
This commit is contained in:
Jon Atkins 2013-09-21 02:17:12 +01:00
parent 8c539078cb
commit 7f9399bbeb

View File

@ -43,11 +43,11 @@ window.playerNameToGuid = function(playerName) {
$.each(Object.keys(sessionStorage), function(ind,key) { $.each(Object.keys(sessionStorage), function(ind,key) {
if(playerName === sessionStorage[key]) { if(playerName === sessionStorage[key]) {
guid = key; guid = key;
window._playerNameToGuidCache[playerName] = guid;
return false; //break from $.each return false; //break from $.each
} }
}); });
window._playerNameToGuidCache[playerName] = guid;
return guid; return guid;
} }