From a2e980c6b8b8804e3aa9241b71eb8c92032e3462 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 14 Feb 2015 17:33:48 -0500 Subject: [PATCH] Hooks - Deferred JSON checking until after we know whether the hooks voluntarily failed the event. --- src/Hooks.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Hooks.cpp b/src/Hooks.cpp index cf66c3063..bdacbbfa9 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -258,12 +258,12 @@ void Hooks::onAdd (Task& task) std::vector outputFeedback; separateOutput (output, outputJSON, outputFeedback); - assertNTasks (outputJSON, 1); - assertValidJSON (outputJSON); - assertSameTask (outputJSON, task); - if (status == 0) { + assertNTasks (outputJSON, 1); + assertValidJSON (outputJSON); + assertSameTask (outputJSON, task); + // Propagate forward to the next script. input[0] = outputJSON[0]; @@ -327,12 +327,12 @@ void Hooks::onModify (const Task& before, Task& after) std::vector outputFeedback; separateOutput (output, outputJSON, outputFeedback); - assertNTasks (outputJSON, 1); - assertValidJSON (outputJSON); - assertSameTask (outputJSON, before); - if (status == 0) { + assertNTasks (outputJSON, 1); + assertValidJSON (outputJSON); + assertSameTask (outputJSON, before); + // Propagate accepted changes forward to the next script. input[1] = outputJSON[0];