aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-08-07 08:51:20 +1000
committernyamatongwe <unknown>2010-08-07 08:51:20 +1000
commit94f1ae8a538bc469ebcf9ae5a56e9ba067541831 (patch)
tree614ab934a9185f5343dbfcab004ff938f71981be /src/Document.cxx
parent37f01ccb6c5292529100ff2f46e0c7c0b12865c5 (diff)
downloadscintilla-mirror-94f1ae8a538bc469ebcf9ae5a56e9ba067541831.tar.gz
Fix crash when calling SCI_REPLACETARGETRE without having done a search first.
Diffstat (limited to 'src/Document.cxx')
-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 {