From 25abf04fdfb2de287970e647259a8e74879a000e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 9 May 2014 22:57:40 -0400 Subject: [PATCH] TW-1318 - TW-1318 creating a UDA in the wrong sequence will cripple taskwarrior (thanks to Onion). --- AUTHORS | 1 + ChangeLog | 2 ++ src/columns/Column.cpp | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index cbcb80fd6..bd7fefa0a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -209,3 +209,4 @@ suggestions: Profpatsch Bernd Humpa darkfeline + Onion diff --git a/ChangeLog b/ChangeLog index edec3b960..675620a56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,8 @@ - TW-1307 burndown is aliased to burndown.weekly (thanks to darkfeline). - TW-1309 memory error, if misconfigured calendar.details.report (thanks to Onion). +- TW-1318 creating a UDA in the wrong sequence will cripple taskwarrior (thanks + to Onion). - Removed deprecated 'echo.command' setting, in favor of the 'header' and 'affected' verbosity tokens. - Removed deprecated 'edit.verbose' setting, in favor of the 'edit' verbosity diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 59330ea61..f39edad9e 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -183,12 +183,13 @@ Column* Column::uda (const std::string& name) std::string key = "uda." + name + ".type"; c->_type = context.config.get (key); if (c->_type == "") - throw format (STRING_UDA_TYPE_MISSING, name); + context.error (format (STRING_UDA_TYPE_MISSING, name)); + if (c->_type != "string" && c->_type != "date" && c->_type != "duration" && c->_type != "numeric") - throw std::string (STRING_UDA_TYPE); + context.error (STRING_UDA_TYPE); key = "uda." + name + ".label"; if (context.config.get (key) != "")