the results variable can be nil when there's no code action available, check for nil results before checking the length