1
0
Fork 0
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:
Andrew Gvozdev 2013-07-12 12:00:36 -04:00
parent d6e51c57a9
commit 8134c7e1cd

View file

@ -92,7 +92,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
@Override
protected String getCompilerCommand(String languageId) {
ITool tool = getTool(languageId);
String compilerCommand = tool.getToolCommand();
String compilerCommand = tool != null ? tool.getToolCommand() : ""; //$NON-NLS-1$
if (compilerCommand.isEmpty()) {
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) {
String ext = null;
ITool tool = getTool(languageId);
String[] srcFileExtensions = tool.getAllInputExtensions();
String[] srcFileExtensions = tool != null ? tool.getAllInputExtensions() : null;
if (srcFileExtensions != null && srcFileExtensions.length > 0) {
ext = srcFileExtensions[0];
}