Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2012-04-02 14:22:43 -0400
committerkmoore2012-04-02 14:22:43 -0400
commitf9f62074f655bf605a755a10237dd9b7130e826a (patch)
treea53cc7193f9822535a9c7d93c5cc547ee5153e3e
parentdf3381ad017a5d728ed338715fb73d1df4e58bff (diff)
downloadwebtools.dali-f9f62074f655bf605a755a10237dd9b7130e826a.tar.gz
webtools.dali-f9f62074f655bf605a755a10237dd9b7130e826a.tar.xz
webtools.dali-f9f62074f655bf605a755a10237dd9b7130e826a.zip
added null check for content type
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/refactoring/JpaDeletePackageOrFolderParticipant.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/refactoring/JpaDeletePackageOrFolderParticipant.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/refactoring/JpaDeletePackageOrFolderParticipant.java
index 5e67cec115..7ad6840b3b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/refactoring/JpaDeletePackageOrFolderParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/refactoring/JpaDeletePackageOrFolderParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -18,6 +18,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
@@ -176,8 +177,11 @@ public class JpaDeletePackageOrFolderParticipant
{
@Override
protected boolean accept(IFile file) {
- return javaProject.isOnClasspath(file)
- && PlatformTools.getContentType(file).isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
+ if (javaProject.isOnClasspath(file)) {
+ IContentType contentType = PlatformTools.getContentType(file);
+ return contentType != null && contentType.isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
+ }
+ return false;
}
};
}

Back to the top