Author: mareshkau
Date: 2007-10-26 11:47:22 -0400 (Fri, 26 Oct 2007)
New Revision: 4544
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
Log:
code adjustment
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-26
14:51:59 UTC (rev 4543)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-26
15:47:22 UTC (rev 4544)
@@ -637,9 +637,9 @@
if (len > 0) {
visualAnchorContainer = visualNodes.item(0);
String text = visualAnchorContainer.getNodeValue();
- if (sourceAnchorOffset <= text.length()) {
+ if (text!=null&& sourceAnchorOffset <= text.length()) {
visualAnchorOffset = sourceAnchorOffset;
- } else {
+ } else if (text!=null) {
visualAnchorOffset = text.length();
}
}
@@ -679,9 +679,9 @@
if (len > 0) {
visualFocusContainer = visualNodes.item(0);
String text = visualFocusContainer.getNodeValue();
- if (sourceFocusOffset <= text.length()) {
+ if (text!=null&&sourceFocusOffset <= text.length()) {
visualFocusOffset = sourceFocusOffset;
- } else {
+ } else if(text!=null) {
visualFocusOffset = text.length();
}
}
Show replies by date