Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better error checking for 'isvalid' function.

  • Loading branch information...
commit 022e4e37e72ed8f0da41ede86090f97c7e11a061 1 parent 9fad319
Chris Schlaeger scrapper authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/taskjuggler/LogicalFunction.rb
14 lib/taskjuggler/LogicalFunction.rb
View
@@ -250,7 +250,19 @@ def isvalid(expr, args)
expr.error("Unknown attribute '#{attr}' used for function " +
"isvalid()")
end
- !property[attr, scenarioIdx].nil?
+ if scenario
+ unless property.attributeDefinition(attr).scenarioSpecific
+ expr.error("Attribute '#{attr}' of property '#{property.fullId}' " +
+ "is not scenario specific. Don't provide a scenario ID!")
+ end
+ !property[attr, scenarioIdx].nil?
+ else
+ if property.attributeDefinition(attr).scenarioSpecific
+ expr.error("Attribute '#{attr}' of property '#{property.fullId}' " +
+ "is scenario specific. Please provide a scenario ID!")
+ end
+ !property.get(attr).nil?
+ end
end
def treelevel(expr, args)
Please sign in to comment.
Something went wrong with that request. Please try again.