Skip to content

Commit b25c9fa

Browse files
committed
Merge PR #1086
2 parents 9390715 + 2c7c559 commit b25c9fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Squirrel/UpdateManager.ApplyReleases.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,15 @@ internal void unshimOurselves()
511511
baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, view);
512512
regKey = baseKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers");
513513

514+
if (regKey == null) return;
515+
514516
var toDelete = regKey.GetValueNames()
515517
.Where(x => x.StartsWith(rootAppDirectory, StringComparison.OrdinalIgnoreCase))
516518
.ToList();
517519

518520
toDelete.ForEach(x =>
519-
this.Log().LogIfThrows(LogLevel.Warn, "Failed to delete key: " + x, () => regKey.DeleteValue(x)));
521+
this.Log().LogIfThrows(LogLevel.Warn, "Failed to delete key: " + x,
522+
() => regKey.DeleteValue(x)));
520523
} catch (Exception e) {
521524
this.Log().WarnException("Couldn't rewrite shim RegKey, most likely no apps are shimmed", e);
522525
} finally {

0 commit comments

Comments
 (0)