fun checkLabel(label: Label?, checkVisited: Boolean, msg: String) { requireNotNull(label) { "Invalid $msg (must not be null)" } require( (checkVisited && labels.get(label) == null)) { "Invalid $msg (must be visited first)" } }
Checks that the given label is not null . This method can also check that the label has been visited .