aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 8a3a367db..6141b0628 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6267,7 +6267,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_SETSTYLING:
- pdoc->SetStyleFor(static_cast<int>(wParam), static_cast<char>(lParam));
+ if (static_cast<int>(wParam) < 0)
+ errorStatus = SC_STATUS_FAILURE;
+ else
+ pdoc->SetStyleFor(static_cast<int>(wParam), static_cast<char>(lParam));
break;
case SCI_SETSTYLINGEX: // Specify a complete styling buffer