From 1c3f6e6d9a651fb9b421fd61f890eed8bfdbfd59 Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 8 May 2014 03:09:28 +0300 Subject: [PATCH] fixed #127: Pushbullet device name null check --- UploadersLib/GUI/UploadersConfigFormGUI.cs | 36 +++++++++---------- UploadersLib/GUI/UploadersConfigFormHelper.cs | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/UploadersLib/GUI/UploadersConfigFormGUI.cs b/UploadersLib/GUI/UploadersConfigFormGUI.cs index bf9eb993b..b93e02ee8 100644 --- a/UploadersLib/GUI/UploadersConfigFormGUI.cs +++ b/UploadersLib/GUI/UploadersConfigFormGUI.cs @@ -224,24 +224,6 @@ public void LoadSettings(UploadersConfig uploadersConfig) txtPaste_eeUserAPIKey.Text = Config.Paste_eeUserAPIKey; - //Pushbullet - - txtPushbulletUserKey.Text = Config.PushbulletSettings.UserAPIKey; - - if (Config.PushbulletSettings.DeviceList.Count > 0) - { - Config.PushbulletSettings.DeviceList.ForEach(x => cboPushbulletDevices.Items.Add(x.Name)); - - if (Config.PushbulletSettings.DeviceList.IsValidIndex(Config.PushbulletSettings.SelectedDevice)) - { - cboPushbulletDevices.SelectedIndex = Config.PushbulletSettings.SelectedDevice; - } - else - { - cboPushbulletDevices.SelectedIndex = 0; - } - } - // Gist atcGistAccountType.SelectedAccountType = Config.GistAnonymousLogin ? AccountType.Anonymous : AccountType.User; @@ -424,6 +406,24 @@ public void LoadSettings(UploadersConfig uploadersConfig) MegaConfigureTab(false); + //Pushbullet + + txtPushbulletUserKey.Text = Config.PushbulletSettings.UserAPIKey; + + if (Config.PushbulletSettings.DeviceList.Count > 0) + { + Config.PushbulletSettings.DeviceList.ForEach(x => cboPushbulletDevices.Items.Add(x.Name ?? "Invalid device name")); + + if (Config.PushbulletSettings.DeviceList.IsValidIndex(Config.PushbulletSettings.SelectedDevice)) + { + cboPushbulletDevices.SelectedIndex = Config.PushbulletSettings.SelectedDevice; + } + else + { + cboPushbulletDevices.SelectedIndex = 0; + } + } + // Amazon S3 txtAmazonS3AccessKey.Text = Config.AmazonS3Settings.AccessKeyID; diff --git a/UploadersLib/GUI/UploadersConfigFormHelper.cs b/UploadersLib/GUI/UploadersConfigFormHelper.cs index 2124951aa..41b15f3c6 100644 --- a/UploadersLib/GUI/UploadersConfigFormHelper.cs +++ b/UploadersLib/GUI/UploadersConfigFormHelper.cs @@ -1135,7 +1135,7 @@ public void PushbulletGetDevices() Config.PushbulletSettings.DeviceList.ForEach(pbDevice => { - cboPushbulletDevices.Items.Add(pbDevice.Name); + cboPushbulletDevices.Items.Add(pbDevice.Name ?? "Invalid device name"); }); cboPushbulletDevices.SelectedIndex = 0;