File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -508,19 +508,23 @@ define([
508508
509509 file . text ( ) . then ( function ( data ) {
510510 // var parsedData = decodeURIComponent(data);
511- var jsonList = JSON . parse ( data ) ;
512- // load blocks
513- that . jsonToBlock ( jsonList ) ;
514-
515- var indexVp = vpFileName . indexOf ( '.vp' ) ;
516- var saveFileName = vpFileName . slice ( 0 , indexVp ) ;
517-
518- // show title of board and path
519- $ ( '#vp_boardTitle' ) . val ( saveFileName ) ;
520- that . tmpState . boardTitle = saveFileName ;
521- that . tmpState . boardPath = vpFilePath ;
522-
523- com_util . renderSuccessMessage ( 'Successfully opened file. (' + vpFileName + ')' ) ;
511+ try {
512+ var jsonList = JSON . parse ( data ) ;
513+ // load blocks
514+ that . jsonToBlock ( jsonList ) ;
515+
516+ var indexVp = vpFileName . indexOf ( '.vp' ) ;
517+ var saveFileName = vpFileName . slice ( 0 , indexVp ) ;
518+
519+ // show title of board and path
520+ $ ( '#vp_boardTitle' ) . val ( saveFileName ) ;
521+ that . tmpState . boardTitle = saveFileName ;
522+ that . tmpState . boardPath = vpFilePath ;
523+
524+ com_util . renderSuccessMessage ( 'Successfully opened file. (' + vpFileName + ')' ) ;
525+ } catch ( ex ) {
526+ com_util . renderAlertModal ( 'Not applicable file contents with vp format! (JSON)' ) ;
527+ }
524528 } ) ;
525529 } ) ;
526530 }
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ define([
8484 this . attributes . push ( { [ key ] : value } ) ;
8585 }
8686 setValue ( value ) {
87+ if ( value == null || value == undefined ) {
88+ value = '' ;
89+ }
8790 this . defaultValue = value ;
8891 if ( value . includes ( '[' ) && value . includes ( ']' ) ) {
8992 // divide it to variable / column
You can’t perform that action at this time.
0 commit comments