1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 10:45:37 +02:00

Bug 425595 - Opening 'C/C++ General-> Formatter' of a project properties

cuases NPE
This commit is contained in:
Sergey Prigogin 2014-01-13 11:37:41 -08:00
parent 6891ce8e0f
commit 74c0954dc8

View file

@ -116,7 +116,8 @@ public class CustomCodeFormatterBlock extends Observable {
public void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
if (useProjectSpecificSettings) {
fPrefs.put(CCorePreferenceConstants.CODE_FORMATTER, fDefaultFormatterId);
if (fDefaultFormatterId != null)
fPrefs.put(CCorePreferenceConstants.CODE_FORMATTER, fDefaultFormatterId);
} else {
initDefault();
}
@ -125,7 +126,7 @@ public class CustomCodeFormatterBlock extends Observable {
/**
* Returns the currently selected formatter id.
*
* @return the selected formatter id or <code>null</code> if the default is selected.
* @return the selected formatter id or {@code null} if the default is selected.
*/
public String getFormatterId() {
if (fFormatterCombo == null) {