# HG changeset patch # User Drew Perttula # Date 2005-06-17 20:49:20 # Node ID e76b112c837ef19f883d5f538d415ef28a8d260d # Parent d482699decbd1791444d348e3edfe9d882314be3 fix empty-subexpr bug diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -131,6 +131,11 @@ class Subterm: make_attributes_from_args('submaster', 'subexpr') def scaled(self, t): subexpr_eval = self.subexpr.eval(t) + # this stops an error that didn't used to happen. i think when + # the expr is empty, subexpr_eval becomes None, so this zero + # is ok + if subexpr_eval is None: + subexpr_eval = 0 if isinstance(subexpr_eval, Submaster.Submaster): # if the expression returns a submaster, just return it return subexpr_eval