diff --git a/epanet_matlab_toolkit/epanet.m b/epanet_matlab_toolkit/epanet.m index 628d384..d5e4db1 100644 --- a/epanet_matlab_toolkit/epanet.m +++ b/epanet_matlab_toolkit/epanet.m @@ -390,7 +390,7 @@ end properties (Constant = true) - classversion='v2.2.6 - Last Update: 11/05/2023'; + classversion='v2.2.6 - Last Update: 26/05/2023'; LOGOP={'IF', 'AND', 'OR'} % Constants for rule-based controls: 'IF', 'AND', 'OR' % EPANET Version 2.2 RULEOBJECT={'NODE', 'LINK', 'SYSTEM'}; % Constants for rule-based controls: 'NODE', 'LINK', 'SYSTEM' % EPANET Version 2.2 @@ -4543,8 +4543,10 @@ function apiMSXMatlabCleanup(obj) %Open the file [obj.Errcode] = obj.apiMSXopen(obj); if obj.Errcode, warning(obj.getMSXError(obj.Errcode)); end - if any(strcmpi(varargin{1}, loadfile_options)) - return + if ~isempty(varargin) + if any(strcmpi(varargin{1}, loadfile_options)) + return + end end obj.MSXEquationsTerms = obj.getMSXEquationsTerms; obj.MSXEquationsPipes = obj.getMSXEquationsPipes;