Fix bug: if code cannot be formatted the format returns null