Filter out "Dot indexing is not supported for variables of this type." error if variable conflicts with namespace

time-shift
Johannes Pfeifer 2021-05-06 10:58:46 +02:00
parent 6fe97182da
commit f43ee91ed8
1 changed files with 7 additions and 2 deletions

View File

@ -280,8 +280,13 @@ clear(['+' fname '/driver'])
try
evalin('base',[fname '.driver']) ;
catch ME
diary off
rethrow(ME)
W = evalin('base','whos');
diary off
if ismember(fname,[W(:).name])
error('Your base workspace already contains a variable with the same name as the mod-file.\nYou need to delete it or rename the mod-file.')
else
rethrow(ME)
end
end
diary off