File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -147,10 +147,14 @@ function envVarUpdate()
147147 % return STATE prior to change
148148 out = STATE ;
149149 if any(strcmpi(operation , {' set' , ' load' }))
150- % merge with existing STATE
151- STATE = rmfield(STATE , intersect(fieldnames(STATE ), fieldnames(new )));
152- names = [fieldnames(STATE ); fieldnames(new )];
153- STATE = orderfields(cell2struct([struct2cell(STATE ); struct2cell(new )], names , 1 ));
150+ if isempty(STATE )
151+ STATE = new ;
152+ else
153+ % merge with existing STATE
154+ STATE = rmfield(STATE , intersect(fieldnames(STATE ), fieldnames(new )));
155+ names = [fieldnames(STATE ); fieldnames(new )];
156+ STATE = orderfields(cell2struct([struct2cell(STATE ); struct2cell(new )], names , 1 ));
157+ end
154158 if strcmpi(operation , ' load' )
155159 envVarUpdate();
156160 end
Original file line number Diff line number Diff line change 22--------------------------
33* Bugfix: Error on accessing unmanaged Imported/Computed tables (#336) PR #338
44* Bugfix: Certain characters in attribute comment not escaped properly (#210, #335) PR #338
5+ * Bugfix: `dj.config.load(...) ` after initial MATLAB boot throws invalid input error. PR #338
56
673.4.0 -- December 11, 2020
78--------------------------
Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ function TestConfig_testLoad(testCase)
197197 base = regexprep(base ,' [a-z0-9][A-Z]' ,' ${$0(1)}_${lower($0(2))}' );
198198 TestConfig .TestConfig_configSingleFileTest(testCase , ' load-custom' , ...
199199 [pkg_path ' /test_schemas/config_lite.json' ], jsondecode(base ));
200+ % test load on launch MATLAB
201+ clear functions ;
202+ dj .config .load([pkg_path ' /test_schemas/config_lite.json' ]);
200203 % cleanup
201204 dj .config .restore ;
202205 end
You can’t perform that action at this time.
0 commit comments