mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00
Bug 538266 - NPE in QuickFixCreateNewClass.isApplicable()
Change-Id: If20b46da95f58e93ba46ea6f4386e841609f4159
This commit is contained in:
parent
a8a29d195a
commit
4549e7f39a
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@ import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
|
|||
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
||||
import org.eclipse.cdt.core.dom.ILinkage;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ILanguage;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.corext.util.CModelUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard;
|
||||
|
@ -67,7 +68,8 @@ public class QuickFixCreateNewClass extends AbstractCodanCMarkerResolution imple
|
|||
public boolean isApplicable(IMarker marker) {
|
||||
return getTranslationUnitViaEditorOrWorkspace(marker).map(tu -> {
|
||||
try {
|
||||
return tu.getLanguage().getLinkageID() != ILinkage.C_LINKAGE_ID;
|
||||
ILanguage language = tu.getLanguage();
|
||||
return language != null && language.getLinkageID() != ILinkage.C_LINKAGE_ID;
|
||||
} catch (CoreException e) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue