aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-08-07 08:51:20 +1000
committernyamatongwe <devnull@localhost>2010-08-07 08:51:20 +1000
commitf14dbb0cd9360609f875e3c641c12f745d5fbdf9 (patch)
treeada14ffec1d202c47a77b0b2f2403f03b0536e7c /src
parentaeac272de9dcc2ba49a8c0662745bc6db98d7be5 (diff)
downloadscintilla-mirror-f14dbb0cd9360609f875e3c641c12f745d5fbdf9.tar.gz
Fix crash when calling SCI_REPLACETARGETRE without having done a search first.
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index fa8ec0857..94b557499 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -1437,7 +1437,10 @@ long Document::FindText(int minPos, int maxPos, const char *search,
}
const char *Document::SubstituteByPosition(const char *text, int *length) {
- return regex->SubstituteByPosition(this, text, length);
+ if (regex)
+ return regex->SubstituteByPosition(this, text, length);
+ else
+ return 0;
}
int Document::LinesTotal() const {