Fix NullPointerException on canceling rule dialog

A NullPointerException was thrown on "Text Checking" -> "Load Rule File..." -> "Add..." -> "Cancel".