fixed case when no Ids are present

Added rescue statement which covers the case when the media has no
associated OS ids