Skip to content

Commit cbb5fd0

Browse files
committed
check for existence of parameters in config file
1 parent fb60a11 commit cbb5fd0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

plotly/plotlyfig.m

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -891,16 +891,22 @@ function delete(obj)
891891

892892
function sharing_value = get_sharing(obj)
893893
config = loadplotlyconfig();
894-
config = config.sharing;
895-
if ~isempty(config)
896-
if strcmp(config, 'private')
897-
sharing_value = false;
898-
elseif strcmp(config, 'secret')
899-
warning('Secret share keys are not currently supported in the MATLAB API.');
900-
sharing_value = false;
894+
if ~isfield(config, 'sharing')
895+
if isfield(config, 'world_readable')
896+
sharing_value = config.world_readable;
897+
return;
901898
else
902899
sharing_value = true;
900+
return;
903901
end
902+
end
903+
904+
config = config.sharing;
905+
if strcmp(config, 'private')
906+
sharing_value = false;
907+
elseif strcmp(config, 'secret')
908+
warning('Secret share keys are not currently supported in the MATLAB API.');
909+
sharing_value = false;
904910
else
905911
sharing_value = true;
906912
end

0 commit comments

Comments
 (0)