Fix an NPE when nothing is selected