Skip to content

Commit 03eee2d

Browse files
committed
fix issue with resolveFilePath if it goes to which()
1 parent a171125 commit 03eee2d

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

widgets/+wt/+utility/resolveFilePath.m

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@
9797

9898

9999
%% Finally, check the MATLAB path
100-
if isfile(fileName)
101100

102-
% Use WHICH to locate the file
103-
filePath = which(fileName);
104-
return
101+
% Use WHICH to locate the file
102+
filePath = which(fileName);
105103

106-
else
104+
% Ensure a string scalar
105+
filePath = string(filePath);
106+
107+
108+
%% Was it found?
109+
110+
if ~isfile(filePath)
107111

108112
% Unable to find the file. Throw a warning.
109113
id = "resolvePathFromFileName:NotFound";
@@ -112,6 +116,5 @@
112116

113117
% Return the original path
114118
filePath = fileName;
115-
return
116119

117120
end %if

0 commit comments

Comments
 (0)