Add null check for status variable

This shoulnd't change something on Windows 10, but it was effectively breaking the program in Windows 7
This commit is contained in:
Charles Milette 2017-10-07 18:06:10 -04:00
parent 204d6c2fa2
commit b4362c0917
No known key found for this signature in database
GPG key ID: 9BC74CC51CB137CE

View file

@ -41,7 +41,7 @@ public StartupTaskState State
get
{
var status = (byte[])Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder", "ShareX.lnk", startupEnabled);
if (!status.SequenceEqual(startupEnabled))
if (status != null && !status.SequenceEqual(startupEnabled))
{
return StartupTaskState.DisabledByUser;
}