session: handle get_flashed_messages() returning None