Fix the resource error check

Signed-off-by: Shea Levy <shea@shealevy.com>