Skip to content

Commit

Permalink
Merge pull request #109 from alistairmcmillan/FixCrashOnStart
Browse files Browse the repository at this point in the history
Fix for crashes on start
  • Loading branch information
cDima authored Feb 5, 2017
2 parents f668bfa + fb2854b commit c858f3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ScreenSaver/Caching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Caching
internal static void Setup()
{
// If there is no location stored in the Registry, use the default location
if (CacheFolder == null)
if (CacheFolder == null || CacheFolder == "")
{
CacheFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Aerial");
}
Expand Down
4 changes: 3 additions & 1 deletion ScreenSaver/RegSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.Win32;
using System;
using System.IO;

namespace ScreenSaver
{
Expand All @@ -9,7 +11,7 @@ public class RegSettings
public bool UseTimeOfDay = true;
public bool MultiscreenDisabled = true;
public bool CacheVideos = true;
public string CacheLocation = "";
public string CacheLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Aerial");

public RegSettings()
{
Expand Down
2 changes: 1 addition & 1 deletion ScreenSaver/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private void LoadSettings()
chkMultiscreenDisabled.Checked = settings.MultiscreenDisabled;
chkCacheVideos.Checked = settings.CacheVideos;

if(settings.CacheLocation == null)
if(settings.CacheLocation == null || settings.CacheLocation == "")
{
txtCacheFolderPath.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Aerial").ToString();
}
Expand Down

0 comments on commit c858f3b

Please sign in to comment.