From d2685a8212405b5a9fae8ce9a6f85e07c95f8872 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 15 Jun 2014 10:15:23 -0400 Subject: [PATCH] Task - If the a numeric attribute is modified with a result that is not readily convertible to a numeric value, then this is an error. --- src/Task.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Task.cpp b/src/Task.cpp index 6be1b7378..596daa6f4 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -2052,6 +2052,11 @@ void Task::modify (modType type, bool text_required /* = false */) e.evaluateInfixExpression (value, v); context.debug (label + name + " <-- " + v.get_string () + " <-- " + value); + // If the result is not readily convertible to a numeric value, + // then this is an error. + if (v.type () == Variant::type_string) + throw format (STRING_UDA_NUMERIC, v.get_string ()); + v.cast (Variant::type_real); v.cast (Variant::type_string);