From 733e004d44ab18651a237b20e70a4a1d283deaca Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 22 Jul 2015 18:38:44 +0100 Subject: [PATCH] Fix potential crash --- src/window.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/window.cc b/src/window.cc index 5396f662..0b720ae5 100644 --- a/src/window.cc +++ b/src/window.cc @@ -272,6 +272,8 @@ CharCoord Window::display_position(ByteCoord coord) const ByteCoord Window::buffer_coord(CharCoord coord) const { + if (m_display_buffer.lines().empty()) + return {0,0}; if (coord <= 0_line) coord = {0,0}; if ((int)coord.line >= m_display_buffer.lines().size())