Skip to content

Commit

Permalink
Update TrayHelper.cs
Browse files Browse the repository at this point in the history
In case you are wondering how iconStreamData can possibly be null :

From https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(Microsoft.Win32.Registry.GetValue);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5.2);k(DevLang-csharp)&rd=true :

Return Value
Type: System.Object
null if the subkey specified by keyName does not exist; otherwise, the value associated with valueName, or defaultValue if valueName is not found.

This happens when installing for a user who has never logged in, using powershell's Invoke-Command  -Credential cmdlet.
  • Loading branch information
iouri-s committed Nov 18, 2015
1 parent ceb12b8 commit a95b985
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Squirrel/TrayHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public unsafe void RemoveDeadEntries(List<string> executablesInPackage, string r
return;
}

if (iconStreamData.Length < 20) return;
if (iconStreamData == null || iconStreamData.Length < 20) return;
var toKeep = new List<byte[]>();
var header = default(IconStreamsHeader);

Expand Down

0 comments on commit a95b985

Please sign in to comment.