Check if corpus has metadata attribute before trying to use it