Check placeholder object exists before trying to access attributes

Fixes #3388