- Timestamp:
- 12/17/12 09:37:16 (12 years ago)
- Location:
- branches/OaaS/HeuristicLab.Services.Optimization.Web/Models
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Web/Models/OptimizationModels.cs
r8545 r9062 42 42 } 43 43 var param = (from par in scenario.InputParameters.Items where par.Value.Name == realKey select par).FirstOrDefault(); 44 if ( !param.Value.TrySetFromString(realValue)) {44 if (param != null && !param.Value.TrySetFromString(realValue)) { 45 45 bindingContext.ModelState.AddModelError(bindingContext.ModelName, new Exception(string.Format("Unable to parse {0} into destination type {1}", value, param.Type))); 46 46 } … … 56 56 var value = bindingContext.ValueProvider.GetValue(key); 57 57 var param = (from par in scenario.AlgorithmParameters.Items where par.Value.Name == key select par).FirstOrDefault(); 58 if ( !param.Value.TrySetFromString(value.AttemptedValue)) {58 if (param != null && !param.Value.TrySetFromString(value.AttemptedValue)) { 59 59 bindingContext.ModelState.AddModelError(bindingContext.ModelName, new Exception(string.Format("Unable to parse {0} into destination type {1}", value, param.Type))); 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.