Issue warnings instead of errors for 'weird' tasks (#3646)

* Issue warnings instead of errors for 'weird' tasks

* Support more comprehensive checks when adding a task
This commit is contained in:
Dustin J. Mitchell 2024-10-22 15:15:51 -04:00 committed by GitHub
parent 4bf6144daf
commit 96c72f3e06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 17 deletions

View file

@ -174,6 +174,9 @@ void CmdImport::importSingleTask(json::object* obj) {
// Parse the whole thing, validate the data.
Task task(obj);
// An empty task is probably not intentional - at least a UUID should be included.
if (task.is_empty()) throw format("Cannot import an empty task.");
auto hasGeneratedEntry = not task.has("entry");
auto hasExplicitEnd = task.has("end");