summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-19 22:29:36 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-19 22:29:36 -0400
commit72c09cc0bf6247a36c9a2dae6109ca4583ff2f6e (patch)
treee762c42ac90edfd5f725d2607c9c699eb7be572e /src/op.cc
parentefc923acb4e902c8bb4cd65a01b85927dfd568b6 (diff)
downloadfork-ledger-72c09cc0bf6247a36c9a2dae6109ca4583ff2f6e.tar.gz
fork-ledger-72c09cc0bf6247a36c9a2dae6109ca4583ff2f6e.tar.bz2
fork-ledger-72c09cc0bf6247a36c9a2dae6109ca4583ff2f6e.zip
Generate a better error if a function operand is invalid.
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/op.cc b/src/op.cc
index b19ac730..75c2d5e8 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -93,12 +93,11 @@ value_t expr_t::op_t::calc(scope_t& scope)
call_args.set_args(right()->calc(scope));
ptr_op_t func = left();
- string name;
assert(func->kind == IDENT);
func = func->left();
- if (func->kind != FUNCTION)
+ if (! func || func->kind != FUNCTION)
throw_(calc_error, "Calling non-function");
return func->as_function()(call_args);