There should be an "else" block here, otherwise it looks like it's possible for control to reach the end of the function without returning.