#15391 add null-query to not get nullpointerexception and rework getQuestionBySortOrder and some minor bugs