We were already looking at the error anyway, but rewriting things this way lets coverity see the light.