File tree 2 files changed +20
-13
lines changed
2 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -508,19 +508,23 @@ define([
508
508
509
509
file . text ( ) . then ( function ( data ) {
510
510
// 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
+ }
524
528
} ) ;
525
529
} ) ;
526
530
}
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ define([
84
84
this . attributes . push ( { [ key ] : value } ) ;
85
85
}
86
86
setValue ( value ) {
87
+ if ( value == null || value == undefined ) {
88
+ value = '' ;
89
+ }
87
90
this . defaultValue = value ;
88
91
if ( value . includes ( '[' ) && value . includes ( ']' ) ) {
89
92
// divide it to variable / column
You can’t perform that action at this time.
0 commit comments