aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
commitc73929a0e75705cdb8adbbdb45ea017e3bb09374 (patch)
tree9df7c0a3880a031e44c7896fd588b370367f9035 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters
parent977d88f94cfb192d09f0253aaf3442f2c17e60f2 (diff)
parent5881b11e25a34acc0230f5316db5783389afe18f (diff)
downloadTango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.tar.gz
Tango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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)