mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
Merge pull request #5006 from BallisticLingonberries/fix-pushbullet
Fix storing invalid/deleted pushbullet devices
This commit is contained in:
commit
2e35136f53
2 changed files with 3 additions and 2 deletions
|
@ -181,7 +181,7 @@ public List<PushbulletDevice> GetDeviceList()
|
||||||
PushbulletResponseDevices devicesResponse = JsonConvert.DeserializeObject<PushbulletResponseDevices>(response);
|
PushbulletResponseDevices devicesResponse = JsonConvert.DeserializeObject<PushbulletResponseDevices>(response);
|
||||||
|
|
||||||
if (devicesResponse != null && devicesResponse.devices != null)
|
if (devicesResponse != null && devicesResponse.devices != null)
|
||||||
return devicesResponse.devices.Select(x => new PushbulletDevice { Key = x.iden, Name = x.nickname }).ToList();
|
return devicesResponse.devices.Where(x => !String.IsNullOrEmpty(x.nickname)).Select(x1 => new PushbulletDevice { Key = x1.iden, Name = x1.nickname }).ToList();
|
||||||
|
|
||||||
return new List<PushbulletDevice>();
|
return new List<PushbulletDevice>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -799,7 +799,8 @@ public void PushbulletGetDevices()
|
||||||
|
|
||||||
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
|
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
|
||||||
{
|
{
|
||||||
cboPushbulletDevices.Items.Add(pbDevice.Name ?? Resources.UploadersConfigForm_LoadSettings_Invalid_device_name);
|
if (!String.IsNullOrEmpty(pbDevice.Name))
|
||||||
|
cboPushbulletDevices.Items.Add(pbDevice.Name);
|
||||||
});
|
});
|
||||||
|
|
||||||
cboPushbulletDevices.SelectedIndex = 0;
|
cboPushbulletDevices.SelectedIndex = 0;
|
||||||
|
|
Loading…
Reference in a new issue