Add missing error checking

Don't assume row scanning succeeds, check it.