fixed #127: Pushbullet device name null check

This commit is contained in:
Jaex 2014-05-08 03:09:28 +03:00
parent 65e07b618c
commit 1c3f6e6d9a
2 changed files with 19 additions and 19 deletions

View file

@ -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;

View file

@ -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;