Skip to content

Commit

Permalink
Adding tolerance for invalid data/types when setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Rapp committed Feb 7, 2017
1 parent 815f6d5 commit a435b8c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Cinteros.XTB.BulkDataUpdater/MainControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,16 @@ private void UpdateRecords()
attributes.Add("statecode");
}
var touch = rbSetTouch.Checked;
var value = rbSetValue.Checked ? GetValue(attributeitem.Metadata.AttributeType) : null;
object value = null;
try
{
value = rbSetValue.Checked ? GetValue(attributeitem.Metadata.AttributeType) : null;
}
catch (Exception e)
{
MessageBox.Show("Value error:\n" + e.Message, "Set value", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
OptionSetValue statevalue = null;
if (attributeitem.Metadata is StatusAttributeMetadata && value is OptionSetValue)
{
Expand Down

0 comments on commit a435b8c

Please sign in to comment.