Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorNathan Ridge2018-01-02 01:06:29 +0000
committerNathan Ridge2018-01-10 05:05:03 +0000
commit49f1411c7b91522ce55e3af40afe5eddb9697a5a (patch)
tree2fdddab9c6a296ba81f5ef213d70fed1569214bd /codan
parent2b7188c9a5baaee90ae7187aa8d4a988ae76f1ee (diff)
downloadorg.eclipse.cdt-49f1411c7b91522ce55e3af40afe5eddb9697a5a.tar.gz
org.eclipse.cdt-49f1411c7b91522ce55e3af40afe5eddb9697a5a.tar.xz
org.eclipse.cdt-49f1411c7b91522ce55e3af40afe5eddb9697a5a.zip
Bug 529338 - NPE in QuickFixUseDotOperator.apply()
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixUseDotOperator.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixUseDotOperator.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixUseDotOperator.java
index 793adf90f4..004ed10ea1 100644
--- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixUseDotOperator.java
+++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixUseDotOperator.java
@@ -39,8 +39,13 @@ public class QuickFixUseDotOperator extends AbstractCodanCMarkerResolution {
region = dad.find(lineOffset + columnOffset, "->", //$NON-NLS-1$
/* forwardSearch */true, /* caseSensitive */true,
/* wholeWord */true, /* regExSearch */false);
+ if (region == null) {
+ CheckersUiActivator.log("QuickFixUseDotOperator failed to find '->'"); //$NON-NLS-1$
+ return;
+ }
document.replace(region.getOffset(), 2, "."); //$NON-NLS-1$
} catch (BadLocationException e) {
+ CheckersUiActivator.log(e);
return;
}
}

Back to the top