summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-23 15:16:27 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-23 15:16:34 +0100
commitb6be421a1f2e512f22080cb3b86a8f3a7aa61306 (patch)
tree1f5b8691c4acb54e6c4e4feb84cba55006ab4431 /src
parentde2dd0cddf79ace6ca285f2fc5b3e5cfd2298b44 (diff)
Added safety when calling Text_Display methods
- before assigning a buffer (Github #845) - also fixed a warning form unused arg in Fl_Terminal
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Text_Display.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index d1f7bb035..35545614e 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1861,7 +1861,7 @@ int Fl_Text_Display::get_absolute_top_line_number() const {
Does nothing if the absolute top line number is not being maintained.
*/
void Fl_Text_Display::absolute_top_line_number(int oldFirstChar) {
- if (maintaining_absolute_top_line_number()) {
+ if (maintaining_absolute_top_line_number() && buffer()) {
if (mFirstChar < oldFirstChar)
mAbsTopLineNum -= buffer()->count_lines(mFirstChar, oldFirstChar);
else