Error handling in case obj is nil

@michaelarmstrong if obj is nil, method will quit silently, without returning an error.