File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -555,13 +555,14 @@ function habitat_data(jsondata, alternative) {
555555
556556 try
557557 {
558- if ( jsondata === undefined || jsondata === "" )
559- return "" ;
558+ if ( jsondata === undefined || jsondata === null ) return "" ;
560559
561- var data = $ . parseJSON ( jsondata ) ;
560+ var data = ( typeof jsondata === "string" ) ? $ . parseJSON ( jsondata ) : jsondata ;
562561 var array = [ ] ;
563562 var output = "" ;
564563
564+ if ( Object . keys ( data ) . length === 0 ) return "" ;
565+
565566 for ( var key in data ) {
566567 array . push ( [ key , data [ key ] ] ) ;
567568 }
@@ -1982,7 +1983,7 @@ function graphAddPosition(vcallsign, new_data) {
19821983 if ( plot && new_data . data !== "" ) {
19831984
19841985 // the rest of the series is from the data field
1985- var json = $ . parseJSON ( new_data . data ) ;
1986+ var json = ( typeof new_data . data === "string" ) ? $ . parseJSON ( new_data . data ) : new_data . data ;
19861987
19871988 // init empty data matrix
19881989 var data_matrix = [ ] ;
You can’t perform that action at this time.
0 commit comments