if task is null then "else" statement in line 106 will be executed. Is it expected behaviour ?