JBIDE-18359: Fixed regression bug

can the selection be null?