mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug #1017
- Fixed bug #1017, which exported invalid JSON when there were no tasks (thanks to Nicholas Rabenau).
This commit is contained in:
parent
128b139b17
commit
180ff95649
2 changed files with 8 additions and 11 deletions
|
@ -53,12 +53,6 @@ int CmdExport::execute (std::string& output)
|
|||
std::vector <Task> filtered;
|
||||
filter (filtered);
|
||||
|
||||
if (filtered.size () == 0)
|
||||
{
|
||||
context.footnote (STRING_FEEDBACK_NO_MATCH);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Note: "limit:" feature not supported.
|
||||
// TODO Why not?
|
||||
|
||||
|
@ -72,16 +66,17 @@ int CmdExport::execute (std::string& output)
|
|||
std::vector <Task>::iterator task;
|
||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||
{
|
||||
if (task != filtered.begin ())
|
||||
output += ",\n";
|
||||
|
||||
output += task->composeJSON (true);
|
||||
|
||||
if (task != filtered.begin ())
|
||||
output += ",";
|
||||
|
||||
output += "\n";
|
||||
}
|
||||
|
||||
if (json_array)
|
||||
output += "\n]";
|
||||
output += "]\n";
|
||||
|
||||
output += "\n";
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue