Fix nullpointer exception when there's no locale selected for sorting

Fix nullpointer exception when there's no locale selected for sorting: https://bugzilla.redhat.com/show_bug.cgi?id=1033411