summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-04-19 14:29:53 +0430
committerLinus Groh <mail@linusgroh.de>2021-04-19 16:28:33 +0200
commit74f0fdab9863970b9d06c083e50fba7093bf6d5e (patch)
tree1e834c7de1fb8c805298a44c219e6daba74eeb0f /Userland/Libraries
parente1e84fe0fef8a844bb54d07258c32e24ef1f96d5 (diff)
downloadserenity-74f0fdab9863970b9d06c083e50fba7093bf6d5e.zip
LibLine: Avoid trying to restore() if the editor isn't initialized
Fixes #6472.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibLine/Editor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp
index 0f0a12b184..8d4dfa54d5 100644
--- a/Userland/Libraries/LibLine/Editor.cpp
+++ b/Userland/Libraries/LibLine/Editor.cpp
@@ -600,7 +600,9 @@ void Editor::really_quit_event_loop()
m_buffer.clear();
m_chars_touched_in_the_middle = buffer().size();
m_is_editing = false;
- restore();
+
+ if (m_initialized)
+ restore();
m_returned_line = string;