AI-844 : sorting may not be set (at least in tests, avoid NPE)