Skip to content

Commit

Permalink
Throw if evaluating a null/empty function
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkail committed Aug 22, 2016
1 parent 195ccce commit fbee47a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ink-engine-runtime/Story.cs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,12 @@ public object EvaluateFunction (string functionName, params object [] arguments)
/// <param name="arguments">The arguments that the ink function takes, if any. Note that we don't (can't) do any validation on the number of arguments right now, so make sure you get it right!</param>
public object EvaluateFunction (string functionName, out string textOutput, params object [] arguments)
{
if(functionName == null) {
throw new System.Exception ("Function is null");
} else if(functionName == string.Empty || functionName.Trim() == string.Empty) {
throw new System.Exception ("Function is empty or white space.");
}

Runtime.Container funcContainer = null;
try {
funcContainer = ContentAtPath (new Path (functionName)) as Runtime.Container;
Expand Down

0 comments on commit fbee47a

Please sign in to comment.