Skip to content
Browse files

fixed potential null pointer access detected by FindBugs

  • Loading branch information...
1 parent 8929448 commit 3d40b551044e724a0518381712fce577da5c671d @mirkoseifert mirkoseifert committed Apr 5, 2013
View
3 Core/SDK/org.emftext.sdk.ui/src/org/emftext/sdk/ui/actions/AbstractGenerateSyntaxAction.java
@@ -46,7 +46,8 @@ public void run(IAction action) {
Object o = i.next();
if (o instanceof IFile) {
IFile file = (IFile) o;
- if (file.getFileExtension().startsWith("genmodel")) {
+ String fileExtension = file.getFileExtension();
+ if (fileExtension != null && fileExtension.startsWith("genmodel")) {
process(file);
}
}
View
3 Core/SDK/org.emftext.sdk.ui/src/org/emftext/sdk/ui/actions/GenerateCustomSyntaxAction.java
@@ -38,7 +38,8 @@ public void run(IAction action) {
Object o = i.next();
if (o instanceof IFile) {
IFile file = (IFile) o;
- if (file.getFileExtension().startsWith("genmodel")) {
+ String fileExtension = file.getFileExtension();
+ if (fileExtension != null && fileExtension.startsWith("genmodel")) {
process(file);
}
}
View
3 Core/SDK/org.emftext.sdk.ui/src/org/emftext/sdk/ui/actions/GenerateResourcePluginAction.java
@@ -45,7 +45,8 @@ public void run(IAction action) {
Object o = i.next();
if (o instanceof IFile) {
IFile file = (IFile) o;
- if (file.getFileExtension().startsWith("cs")) {
+ String fileExtension = file.getFileExtension();
+ if (fileExtension != null && fileExtension.startsWith("cs")) {
process(file);
}
}

0 comments on commit 3d40b55

Please sign in to comment.
Something went wrong with that request. Please try again.