Fix issue where null variable causes task to not