Making sure all paths return something

Callers (specifically, the Werkzeug debugger middleware) may rely on being able to iterate over the result of this function. This change makes sure they don't choke on receiving None.