mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
fixed #127: Pushbullet device name null check
This commit is contained in:
parent
65e07b618c
commit
1c3f6e6d9a
2 changed files with 19 additions and 19 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue