1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

JUnit-Tests: Fixes an occasional NPE

This commit is contained in:
Markus Schorn 2007-08-30 09:41:35 +00:00
parent e1fd233516
commit 4d7f508f83

View file

@ -118,13 +118,18 @@ public class CProjectHelper {
* @param project
* @throws CoreException
*/
public static void addDefaultBinaryParser(IProject project) throws CoreException {
public static boolean addDefaultBinaryParser(IProject project) throws CoreException {
ICExtensionReference[] binaryParsers= CCorePlugin.getDefault().getBinaryParserExtensions(project);
if (binaryParsers == null || binaryParsers.length == 0) {
ICProjectDescription desc= CCorePlugin.getDefault().getProjectDescription(project);
if (desc == null) {
return false;
}
desc.getDefaultSettingConfiguration().create(CCorePlugin.BINARY_PARSER_UNIQ_ID, CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID);
CCorePlugin.getDefault().setProjectDescription(project, desc);
}
return true;
}
/**