From 30447e7806d90bb35b9539b47feed181ffbe254a Mon Sep 17 00:00:00 2001
From: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Date: Tue, 2 Jun 2015 01:22:24 -0400
Subject: [PATCH] Bug 469066 - NPE in
 CrossGCCBuiltinSpecsDetector.getCompilerCommand

Change-Id: Ie79a6043c742d9cd42bb846e5736676d9d0cbd6c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
---
 .../build/crossgcc/CrossGCCBuiltinSpecsDetector.java        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossGCCBuiltinSpecsDetector.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossGCCBuiltinSpecsDetector.java
index fc26b62374f..88c3616da92 100644
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossGCCBuiltinSpecsDetector.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossGCCBuiltinSpecsDetector.java
@@ -23,14 +23,16 @@ public class CrossGCCBuiltinSpecsDetector extends GCCBuiltinSpecsDetector {
 	protected String getCompilerCommand(String languageId) {
 		// Include the cross command prefix (tool option) in the ${COMMAND} macro
 		// For example: "arch-os-" + "gcc"
-		String prefix = "";
+		String prefix = ""; //$NON-NLS-1$
 		IToolChain toolchain = null;
 		if (currentCfgDescription != null) {
 			IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(currentCfgDescription);
 			toolchain = cfg != null ? cfg.getToolChain() : null;
 			if (toolchain != null) {
 				IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.prefix"); //$NON-NLS-1$
-				prefix = (String)option.getValue();
+				if (option != null) {
+					prefix = (String) option.getValue();
+				}
 			}
 		}
 		return prefix + super.getCompilerCommand(languageId);