diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj index 2852b58..9c1557b 100644 --- a/ColorControl/ColorControl.csproj +++ b/ColorControl/ColorControl.csproj @@ -27,7 +27,7 @@ ColorControl Maassoft 0 - 1.3.0.0 + 1.3.1.0 false true true diff --git a/ColorControl/LgService.cs b/ColorControl/LgService.cs index 4761325..a746abe 100644 --- a/ColorControl/LgService.cs +++ b/ColorControl/LgService.cs @@ -112,7 +112,7 @@ private void SetDevicesTask(Task> task) Devices = task.Result; if (Devices?.Count > 0) { - var preferredDevice = Devices.FirstOrDefault(x => x.MacAddress.Equals(Config.PreferredMacAddress)) ?? Devices[0]; + var preferredDevice = Devices.FirstOrDefault(x => x.MacAddress != null && x.MacAddress.Equals(Config.PreferredMacAddress)) ?? Devices[0]; SelectedDevice = preferredDevice; } diff --git a/ColorControl/MainForm.cs b/ColorControl/MainForm.cs index 587e60a..41762ae 100644 --- a/ColorControl/MainForm.cs +++ b/ColorControl/MainForm.cs @@ -193,7 +193,7 @@ public MainForm(StartUpParams startUpParams) if (_lgService != null) { - SystemEvents.SessionEnded += new SessionEndedEventHandler(SessionEnded); + //SystemEvents.SessionEnded += new SessionEndedEventHandler(SessionEnded); SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(PowerModeChanged); } diff --git a/ColorControl/Program.cs b/ColorControl/Program.cs index 33b5224..a31b045 100644 --- a/ColorControl/Program.cs +++ b/ColorControl/Program.cs @@ -31,9 +31,16 @@ static void Main(string[] args) } else { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm(startUpParams)); + try + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm(startUpParams)); + } + catch (Exception ex) + { + MessageBox.Show("Error while initializing application: " + ex.ToLogString(Environment.StackTrace), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } finally diff --git a/ColorControl/Properties/AssemblyInfo.cs b/ColorControl/Properties/AssemblyInfo.cs index 33de681..ede13d2 100644 --- a/ColorControl/Properties/AssemblyInfo.cs +++ b/ColorControl/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")]