IDEA-187187 Save settings failed: "Cannot get ScratchFileService component state"

This commit is contained in:
Gregory.Shrago
2018-02-26 16:28:58 +03:00
parent 6656407a5e
commit 0a57aba09e
@@ -214,14 +214,13 @@ public abstract class PerFileMappingsBase<T> implements PersistentStateComponent
return o1.getPath().compareTo(o2.getPath());
});
for (VirtualFile file : files) {
final T dialect = myMappings.get(file);
String value = serialize(dialect);
if (value != null) {
final Element child = new Element("file");
element.addContent(child);
child.setAttribute("url", file == null ? "PROJECT" : file.getUrl());
child.setAttribute(getValueAttribute(), value);
}
T dialect = myMappings.get(file);
String value = dialect == null ? null : serialize(dialect);
if (value == null) continue;
Element child = new Element("file");
element.addContent(child);
child.setAttribute("url", file == null ? "PROJECT" : file.getUrl());
child.setAttribute(getValueAttribute(), value);
}
return element;
}