diff --git a/src/runner.c b/src/runner.c
index 0dd6d0668413922abcd49ca6edaef373d85bc653..5b09b8989806901eec824e514406e421c9daf807 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1790,7 +1790,7 @@ void *runner_main(void *data) {
 
         /* Special case for sorts */
         if (!cell_is_active(ci, e) && t->type == task_type_sort &&
-            t->flags == 0)
+            !(ci->do_sort || ci->do_sub_sort))
           error(
               "Task (type='%s/%s') should have been skipped ti_current=%lld "
               "c->ti_end_min=%lld t->flags=%d",