Skip to content

Commit

Permalink
Added chroma exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasdeory committed Mar 28, 2020
1 parent 1073fdc commit 5f81587
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions LedDashboard/RazerChromaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ public static RazerChromaController Create()

private RazerChromaController()
{
if (api == null) api = new NativeRazerApi();
if (keyboardFrame == null) keyboardFrame = new KeyboradFrame(api);
try
{
if (api == null) api = new NativeRazerApi();
if (keyboardFrame == null) keyboardFrame = new KeyboradFrame(api);
} catch (Exception e)
{
throw new InvalidOperationException("Error initializing Razer Chroma controller. Is Razer Synapse installed?", e);
}

}

public void SendData(int ledCount, byte[] colorArray)
Expand Down

0 comments on commit 5f81587

Please sign in to comment.