Skip to content

Commit

Permalink
Bail out of updating settings if the configuration is not valid or en…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
niemyjski committed May 10, 2016
1 parent d8ede19 commit 666f08f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Source/Shared/Configuration/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,9 @@ public static void CheckVersion(int version, ExceptionlessConfiguration config)
}

public static void UpdateSettings(ExceptionlessConfiguration config, int? version = null) {
if (config == null)
if (config == null || !config.IsValid || !config.Enabled)
return;

if (String.IsNullOrEmpty(config.ApiKey) || String.Equals(config.ApiKey, "API_KEY_HERE", StringComparison.OrdinalIgnoreCase)) {
config.Resolver.GetLog().Error(typeof(SettingsManager), "Unable to update settings: ApiKey is not set.");
return;
}

try {
if (!version.HasValue || version < 0)
version = GetVersion(config);
Expand Down

0 comments on commit 666f08f

Please sign in to comment.