TRUNK-4464: java.lang.NullPointerException when starting a scheduled task
(cherry picked from commit a1e5724620bbd73742a12787b21560b6df9530bf)