Skip to content

Commit

Permalink
[Fixes bug #750441] Ensure the settings directory exists before tryin…
Browse files Browse the repository at this point in the history
…g to use it.
  • Loading branch information
jpobst committed Apr 5, 2011
1 parent e2d5735 commit bd8c39b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Pinta.Core/Managers/SettingsManager.cs
Expand Up @@ -45,7 +45,14 @@ public SettingsManager ()

public string GetUserSettingsDirectory ()
{
return Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "Pinta");
var settings_dir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "Pinta");

// If someone is getting this, they probably are going to need
// the directory created, so just handle that here.
if (!Directory.Exists (settings_dir))
Directory.CreateDirectory (settings_dir);

return settings_dir;
}

public T GetSetting<T> (string key, T defaultValue)
Expand Down

0 comments on commit bd8c39b

Please sign in to comment.