Skip to content

Commit 6fb2ad1

Browse files
committed
fix for registry missing value crash
1 parent b816423 commit 6fb2ad1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Project-Aurora/Project-Aurora/Utils/RegistryWatcher.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ public void StartWatching()
5555
var query = new WqlEventQuery(queryString);
5656
_eventWatcher = new ManagementEventWatcher(scope, query);
5757
_eventWatcher.EventArrived += KeyWatcherOnEventArrived;
58-
_eventWatcher.Start();
58+
try
59+
{
60+
_eventWatcher.Start();
5961

60-
SendData();
62+
SendData();
63+
}
64+
catch (Exception e)
65+
{
66+
Global.logger.Error("Registry not available, Query: {0}", queryString);
67+
}
6168
}
6269

6370
public void StopWatching()

0 commit comments

Comments
 (0)