Skip to content

Commit

Permalink
Fix recently introduced crashing bug in have_feature_table().
Browse files Browse the repository at this point in the history
Crashes under Octave when Tablicious is not present at all (present but not loaded worked fine).
  • Loading branch information
rdzman committed Feb 13, 2024
1 parent a2ab0f6 commit 997c4ee
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/have_feature_table.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@
% See https://matpower.org for more info.

TorF = exist('table', 'file') == 2;
if TorF && have_feature('matlab')
vstr = have_feature('matlab', 'vstr');
rdate = have_feature('matlab', 'date');
else
v = ver('tablicious');
if ~isempty(v) && isfield(v, 'Version')
vstr = v.Version;
end
if ~isempty(v) && isfield(v, 'Date')
rdate = v.Date;
vstr = '';
rdate = '';
if TorF
if have_feature('matlab')
vstr = have_feature('matlab', 'vstr');
rdate = have_feature('matlab', 'date');
else
v = ver('tablicious');
if ~isempty(v) && isfield(v, 'Version')
vstr = v.Version;
end
if ~isempty(v) && isfield(v, 'Date')
rdate = v.Date;
end
end
end

0 comments on commit 997c4ee

Please sign in to comment.