Prevent type error in foreach() loop.

It is possible that getRepresentations() returns null, so we need to ensure that the return value is
actually an array before attempting to loop over it.
Merge pull request #100 from leftclickben/PROV911

PROV-911 Prevent type error in foreach() loop.