This commit is contained in:
Alexander Doroshko
2012-12-20 16:37:22 +04:00
parent e4d553af66
commit 69a9d11035
@@ -120,7 +120,7 @@ public final class LoadTextUtil {
Charset charset = virtualFile.isCharsetSet() ? virtualFile.getCharset() : detectCharset(virtualFile, content);
Pair<Charset,byte[]> bomAndCharset = getBOMAndCharset(content, charset);
final byte[] bom = bomAndCharset.second;
if (saveBOM && bom.length != 0) {
if (saveBOM && bom != null && bom.length != 0) {
virtualFile.setBOM(bom);
}
return bomAndCharset;