mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +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
|
@ -172,6 +172,12 @@ int CmdImport::execute (std::string& output)
|
|||
json::string* when = (json::string*)annotation->_data["entry"];
|
||||
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 ();
|
||||
|
||||
annos.insert (std::make_pair (name, what->_data));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue