From: Tara L Andrews Date: Wed, 20 Jun 2012 14:19:28 +0000 (+0200) Subject: color_inactive might run before readingdata has been fetched X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f52467de2be0f8d7de9da735d717a016cbc23aac;p=scpubgit%2Fstemmatology.git color_inactive might run before readingdata has been fetched --- diff --git a/stemmaweb/root/js/relationship.js b/stemmaweb/root/js/relationship.js index 807b5d4..72f83b2 100644 --- a/stemmaweb/root/js/relationship.js +++ b/stemmaweb/root/js/relationship.js @@ -136,11 +136,13 @@ function color_inactive ( el ) { // If the reading info has any non-disambiguated lexemes, color it yellow; // otherwise color it green. $(el).attr( {stroke:'green', fill:'#b3f36d'} ); - $.each( reading_info['lexemes'], function ( idx, lex ) { - if( !lex['is_disambiguated'] || lex['is_disambiguated'] == 0 ) { - $(el).attr( {stroke:'orange', fill:'#fee233'} ); - } - }); + if( reading_info ) { + $.each( reading_info['lexemes'], function ( idx, lex ) { + if( !lex['is_disambiguated'] || lex['is_disambiguated'] == 0 ) { + $(el).attr( {stroke:'orange', fill:'#fee233'} ); + } + }); + } } function relemmatize () {