[Monodevelop-patches-list] r435 - trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Jan 10 22:32:31 EST 2004


Author: benm
Date: 2004-01-10 22:32:31 -0500 (Sat, 10 Jan 2004)
New Revision: 435

Modified:
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
Log:
fix for (;;)

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs	2004-01-11 03:29:05 UTC (rev 434)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs	2004-01-11 03:32:31 UTC (rev 435)
@@ -339,16 +339,23 @@
 		}
 		public virtual object Visit(ForStatement forStatement, object data)
 		{
-			object ret = data;
-			foreach(INode n in forStatement.Initializers) {
-				n.AcceptVisitor(this, data);
-			}
+			object ret = data;
+			if (forStatement.Initializers != null) { 
+				foreach(INode n in forStatement.Initializers) {
+					if (n != null) n.AcceptVisitor(this, data);
+				}
+			}
+			
 			if (forStatement.Condition != null) {
 				ret = forStatement.Condition.AcceptVisitor(this, data);
-			}
-			foreach(INode n in forStatement.Iterator) {
-				n.AcceptVisitor(this, data);
-			}
+			}
+			
+			if (forStatement.Iterator != null) {
+				foreach(INode n in forStatement.Iterator) {
+					if (n != null) n.AcceptVisitor(this, data);
+				}
+			}
+			
 			if (forStatement.EmbeddedStatement == null) {
 				return ret;
 			}




More information about the Monodevelop-patches-list mailing list