This commit fixes the crash, but it seems that the sorting doesn't work correctly with or without any vertices assigned.
svn status