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:
parent
e1fd233516
commit
4d7f508f83
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue