aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-03-18 15:01:20 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-03-18 15:01:20 +0200
commit73327143a2ac187695bed0ecded52c4d675165c4 (patch)
treeff6bfefea3bb1e599e4369e649471aedfbea0878 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters
parentbb64c44b3b3a24405a879b26ff01061963e28766 (diff)
downloadTango-73327143a2ac187695bed0ecded52c4d675165c4.tar.gz
Tango-73327143a2ac187695bed0ecded52c4d675165c4.zip
Fixed issue with brush stop duplication on developer module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs
index e59141e7f..5939bfd53 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs
@@ -14,8 +14,15 @@ namespace Tango.MachineStudio.Developer.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- IEnumerable<LiquidVolume> liquid_volumes = value as IEnumerable<LiquidVolume>;
- return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32());
+ if (value != null)
+ {
+ IEnumerable<LiquidVolume> liquid_volumes = value as IEnumerable<LiquidVolume>;
+ return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32());
+ }
+ else
+ {
+ return null;
+ }
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)