|
From: <jas...@us...> - 2006-07-20 05:33:41
|
Revision: 1532 Author: jasonpmorrison Date: 2006-07-19 22:33:35 -0700 (Wed, 19 Jul 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1532&view=rev Log Message: ----------- Null check Modified Paths: -------------- branches/type_inferrence/trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java Modified: branches/type_inferrence/trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java =================================================================== --- branches/type_inferrence/trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java 2006-07-20 05:22:46 UTC (rev 1531) +++ branches/type_inferrence/trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java 2006-07-20 05:33:35 UTC (rev 1532) @@ -60,6 +60,7 @@ this.root = null; } this.orig = OffsetNodeLocator.Instance().getNodeAtOffset(root, offset); + if ( orig == null ) { return null; } if ( orig.getPosition().getEndOffset() > offset + length ) { // Selection spans nodes; not handling that for now. @@ -75,6 +76,7 @@ public List<Position> perform() { // Mark no occurrences if root is null (AST couldn't be parsed correctly.) if ( root == null ) return new LinkedList<Position>(); + if ( orig == null ) return new LinkedList<Position>(); // occurrences to return List<ISourcePosition> occurrences = new LinkedList<ISourcePosition>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |