DATASOLR-129 - introduced null check when getting entity information

Introduced null check and wrote test therefore.