mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Fixed NPE in ToolchainBuiltinSpecsDetector for an edge case when no tool is defined in a toolchain.
This commit is contained in:
parent
d6e51c57a9
commit
8134c7e1cd
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
|
||||||
@Override
|
@Override
|
||||||
protected String getCompilerCommand(String languageId) {
|
protected String getCompilerCommand(String languageId) {
|
||||||
ITool tool = getTool(languageId);
|
ITool tool = getTool(languageId);
|
||||||
String compilerCommand = tool.getToolCommand();
|
String compilerCommand = tool != null ? tool.getToolCommand() : ""; //$NON-NLS-1$
|
||||||
if (compilerCommand.isEmpty()) {
|
if (compilerCommand.isEmpty()) {
|
||||||
ManagedBuilderCorePlugin.error("Unable to find compiler command in toolchain=" + getToolchainId()); //$NON-NLS-1$
|
ManagedBuilderCorePlugin.error("Unable to find compiler command in toolchain=" + getToolchainId()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
|
||||||
protected String getSpecFileExtension(String languageId) {
|
protected String getSpecFileExtension(String languageId) {
|
||||||
String ext = null;
|
String ext = null;
|
||||||
ITool tool = getTool(languageId);
|
ITool tool = getTool(languageId);
|
||||||
String[] srcFileExtensions = tool.getAllInputExtensions();
|
String[] srcFileExtensions = tool != null ? tool.getAllInputExtensions() : null;
|
||||||
if (srcFileExtensions != null && srcFileExtensions.length > 0) {
|
if (srcFileExtensions != null && srcFileExtensions.length > 0) {
|
||||||
ext = srcFileExtensions[0];
|
ext = srcFileExtensions[0];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue