EA-49128 if project already disposed return default charset

This commit is contained in:
Nadya Zabrodina
2014-02-07 15:20:25 +04:00
parent 89bdb116ff
commit a1378e834e
@@ -18,13 +18,11 @@ public class HgEncodingUtil {
if (HGENCODING != null && HGENCODING.length() > 0 && Charset.isSupported(HGENCODING)) {
return Charset.forName(HGENCODING);
}
else {
Charset defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset();
if (defaultCharset != null) {
return defaultCharset;
}
Charset defaultCharset = null;
if (!project.isDisposed()) {
defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset();
}
return Charset.defaultCharset();
return defaultCharset != null ? defaultCharset : Charset.defaultCharset();
}
@NotNull