The doc says it returns 0 is the package doesn't exist. I am not sure how you could not have attachments, check your APM.