Skip to content

Commit

Permalink
Fixes #1537 add warning container task (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
msevestre authored Mar 9, 2022
1 parent 66f5b65 commit 7b1a204
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/OSPSuite.R/Services/ContainerTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,15 @@ private IQuantity singleQuantityByPath(IModelCoreSimulation simulation, string p

var pathArray = path.ToPathArray();
var quantity = simulation.Model.Root.EntityAt<IQuantity>(pathArray);
if (quantity == null && throwIfNotFound)

if (quantity != null)
return quantity;

if (throwIfNotFound)
throw new OSPSuiteException(Error.CouldNotFindQuantityWithPath(path));

return quantity;
_logger.AddWarning(Error.CouldNotFindQuantityWithPath(path));
return null;
}

private string[] allEntityPathIn<T>(IContainer container, Func<T, bool> filterFunc = null) where T : class, IEntity
Expand Down

0 comments on commit 7b1a204

Please sign in to comment.