Skip to content

Commit

Permalink
Fix for issue #20 (NullReferenceException)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisDiligens committed Mar 9, 2023
1 parent a5ca881 commit ddf2a21
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
25 changes: 16 additions & 9 deletions Fo76ini/Interface/Theming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,23 @@ public static Theme SystemTheme

public static ThemeType DetectSystemTheme ()
{
RegistryKey registry =
Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");

if (registry == null)
return ThemeType.Light;
else if ((int)registry.GetValue("AppsUseLightTheme") == 1) // SystemUsesLightTheme
try
{
RegistryKey registry =
Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");

if (registry == null)
return ThemeType.Light;
else if ((int)registry.GetValue("AppsUseLightTheme") == 1) // SystemUsesLightTheme
return ThemeType.Light;
else
return ThemeType.Dark;
}
catch
{
return ThemeType.Light;
else
return ThemeType.Dark;
}
}

#region Theme variables
Expand Down
2 changes: 1 addition & 1 deletion Fo76ini/Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Fo76ini
/// </summary>
public class Shared
{
public const string VERSION = "1.12.5";
public const string VERSION = "1.12.5.1";
public static string LatestVersion = null;

public static readonly string AppInstallationFolder = Directory.GetParent(Application.ExecutablePath).ToString();
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.5
1.12.5.1
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define MyAppURL "https://www.nexusmods.com/fallout76/mods/546"
#define MyAppExeName "Fo76ini.exe"

#define ProjectVersion "1.12.5"
#define ProjectVersion "1.12.5.1"
#define ProjectGitDir "D:\Workspace\Fallout76-QuickConfiguration"

#define AppConfigDir "{localappdata}\Fallout 76 Quick Configuration"
Expand Down

0 comments on commit ddf2a21

Please sign in to comment.