aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Editor.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 2af278b19..1126b27ff 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5764,7 +5764,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_CREATEDOCUMENT: {
Document *doc = new Document();
- doc->AddRef();
+ if (doc) {
+ doc->AddRef();
+ }
return reinterpret_cast<sptr_t>(doc);
}