LibItemCache: Fixed error when realm is not connected