mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-04 10:37:19 +02:00
Bug #1016
- Fixed bug #1016, which caused segfaults when importing JSON with annotations that lack description or entry date (thanks to Nicholas Rabenau).
This commit is contained in:
parent
3e36438597
commit
128b139b17
4 changed files with 11 additions and 0 deletions
1
AUTHORS
1
AUTHORS
|
@ -140,4 +140,5 @@ suggestions:
|
||||||
Paul Kishimoto
|
Paul Kishimoto
|
||||||
Jeff Schroeder
|
Jeff Schroeder
|
||||||
Bryan Kam
|
Bryan Kam
|
||||||
|
Nicholas Rabenau
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,8 @@ Bugs
|
||||||
+ Fixed bug #1008, which failed to remove tasks with the special tag '+nocal'
|
+ Fixed bug #1008, which failed to remove tasks with the special tag '+nocal'
|
||||||
from the calendar report output with 'calendar.details=full' set (thanks to
|
from the calendar report output with 'calendar.details=full' set (thanks to
|
||||||
Bryan Kam).
|
Bryan Kam).
|
||||||
|
+ Fixed bug #1016, which caused segfaults when importing JSON with annotations
|
||||||
|
that lack description or entry date (thanks to Nicholas Rabenau).
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,12 @@ int CmdImport::execute (std::string& output)
|
||||||
json::string* when = (json::string*)annotation->_data["entry"];
|
json::string* when = (json::string*)annotation->_data["entry"];
|
||||||
json::string* what = (json::string*)annotation->_data["description"];
|
json::string* what = (json::string*)annotation->_data["description"];
|
||||||
|
|
||||||
|
if (! when)
|
||||||
|
throw format (STRING_CMD_IMPORT_NO_ENTRY, *line);
|
||||||
|
|
||||||
|
if (! what)
|
||||||
|
throw format (STRING_CMD_IMPORT_NO_DESC, *line);
|
||||||
|
|
||||||
std::string name = "annotation_" + Date (when->_data).toEpochString ();
|
std::string name = "annotation_" + Date (when->_data).toEpochString ();
|
||||||
|
|
||||||
annos.insert (std::make_pair (name, what->_data));
|
annos.insert (std::make_pair (name, what->_data));
|
||||||
|
|
|
@ -396,6 +396,8 @@
|
||||||
#define STRING_CMD_IMPORT_FILE "Importing '{1}'"
|
#define STRING_CMD_IMPORT_FILE "Importing '{1}'"
|
||||||
#define STRING_CMD_IMPORT_BAD_ATT "Unrecognized attribute '{1}'"
|
#define STRING_CMD_IMPORT_BAD_ATT "Unrecognized attribute '{1}'"
|
||||||
#define STRING_CMD_IMPORT_NOT_JSON "Not a JSON object: {1}"
|
#define STRING_CMD_IMPORT_NOT_JSON "Not a JSON object: {1}"
|
||||||
|
#define STRING_CMD_IMPORT_NO_DESC "Annotation is missing a description: {1}"
|
||||||
|
#define STRING_CMD_IMPORT_NO_ENTRY "Annotation is missing an entry date: {1}"
|
||||||
#define STRING_CMD_SHELL_USAGE "Launches an interactive shell"
|
#define STRING_CMD_SHELL_USAGE "Launches an interactive shell"
|
||||||
#define STRING_CMD_SHELL_HELP1 "Enter any task command (such as 'list'), or hit 'Enter'."
|
#define STRING_CMD_SHELL_HELP1 "Enter any task command (such as 'list'), or hit 'Enter'."
|
||||||
#define STRING_CMD_SHELL_HELP2 "There is no need to include the 'task' command itself."
|
#define STRING_CMD_SHELL_HELP2 "There is no need to include the 'task' command itself."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue