Add missing check

All other lines in this function check the return value, except for this
one; that seems like a mistake.