Fix crash in case of empty rule