CPS: Fix crash when package `requires` isn't an object

Check whether a package `requires` is actually an object before trying
to iterate over it.
4 files changed