Found another check that should be before the other one.

Num should be checked before accessing the array. Meant to group this with the other pull request. But only after I made the request was when I saw it, and the pull request got accepted before I could push it.

My bad.