1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Bug 452757 - Handle null attribute values

Change-Id: I99be71f80f14ae0befafd003010e3130404ed578
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2014-12-03 15:00:40 -05:00
parent c6c146049c
commit 5a627b8184

View file

@ -165,8 +165,9 @@ public class JSchConnectionAttributes {
} }
private void loadSecureAttributes() { private void loadSecureAttributes() {
if (fSecureAttributesLoaded) if (fSecureAttributesLoaded) {
return; return;
}
ISecurePreferences secNode = getSecurePreferences(); ISecurePreferences secNode = getSecurePreferences();
try { try {
@ -199,7 +200,11 @@ public class JSchConnectionAttributes {
Preferences node = getPreferences(); Preferences node = getPreferences();
synchronized (fAttributes) { synchronized (fAttributes) {
for (Entry<String, String> entry : fAttributes.entrySet()) { for (Entry<String, String> entry : fAttributes.entrySet()) {
if (entry.getValue() != null) {
node.put(entry.getKey(), entry.getValue()); node.put(entry.getKey(), entry.getValue());
} else {
node.remove(entry.getKey());
}
} }
} }
if (fSecureAttributesLoaded) { if (fSecureAttributesLoaded) {