diff --git a/matlab/telemetry.m b/matlab/telemetry.m index 06cd1e4..baab2d0 100644 --- a/matlab/telemetry.m +++ b/matlab/telemetry.m @@ -38,8 +38,13 @@ function telemetry(telemetry_data, input_path, output_path) end home_dir = environment("HOME"); - loadenv(fullfile(home_dir, '.pet2bidsconfig'), FileType='env'); - % convert string to boolean/logical + try + loadenv(fullfile(home_dir, '.pet2bidsconfig'), FileType='env'); + % convert string to boolean/logical + catch ME + disable_telemetry = false; + end + disable_telemetry = strcmpi(getenv("TELEMETRY_ENABLED"), 'false'); if disable_telemetry | disable_telemetry_env