pdf: fix crash when aMetadata is null