Commit c5ec6846 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ fix for #1, Exception in checkLocalDefinitionsComeFirst

parent aab37516
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -399,8 +399,14 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
			lastDef = NodeModelUtils.getNode(altstep.local.defs.last).startLine
		}

		if (control != null && control.list.localDef != null) {
		if (control != null) {
			//DONE: this should probably include localInst as well
//			if (control.list.localDef != null) {
			if (!control.list.localDef.empty) {
				lastDef = NodeModelUtils.getNode(control.list.localDef.last).startLine
			} else if (!control.list.localInst.empty) {
				lastDef = NodeModelUtils.getNode(control.list.localInst.last).startLine
			}
		}

		if (lastDef > Integer.MIN_VALUE && line > lastDef) {