check if args is nil when encoding a task to JSON