Skip to content
Snippets Groups Projects
Commit 44dcb998 authored by Eric Wait's avatar Eric Wait
Browse files

Deal with reading metadata better if malformed path

parent ab088a0f
No related branches found
No related tags found
No related merge requests found
......@@ -16,13 +16,14 @@ if (~exist('root','var') || isempty(root))
root = '';
end
if (~isempty(root) && ~any(strcmp(root(end),{'\','/'})) && exist(root,'dir'))
[~,~,ext] = fileparts(root);
if (~isempty(root) && ~any(strcmp(root(end),{'\','/'})) && exist(root,'dir') && isempty(ext))
root = fullfile(root, filesep);
end
% This is to help when the filename might have '.' whithin them
% TODO rework this logic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (exist([root,'.json'],'file'))
if (isempty(ext) && exist([root,'.json'],'file'))
root = [root,'.json'];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment