Document: npe in assertion fixed

This commit is contained in:
Anton Makeev
2011-12-05 13:57:41 +01:00
parent eca30e8f04
commit fdac4892a4
@@ -526,9 +526,12 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
@NotNull
private DocumentEvent doBeforeChangedUpdate(int offset, CharSequence oldString, CharSequence newString, boolean wholeTextReplaced) {
VirtualFile file = FileDocumentManager.getInstance().getFile(this);
if (file != null && !file.isValid()) {
LOG.error("File of this document has been deleted.");
FileDocumentManager manager = FileDocumentManager.getInstance();
if (manager != null) {
VirtualFile file = manager.getFile(this);
if (file != null && !file.isValid()) {
LOG.error("File of this document has been deleted.");
}
}
DocumentEvent event = new DocumentEventImpl(this, offset, oldString, newString, myModificationStamp, wholeTextReplaced);