ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=4af09363316acaa57e711fb7d064c7d988afba5d

commit 4af09363316acaa57e711fb7d064c7d988afba5d
Author: Andy Williams <a...@andywilliams.me>
Date:   Wed Jun 10 23:32:15 2015 +0100

    editor: Fix crash opening empty files
---
 elm_code/src/lib/widget/elm_code_widget_text.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elm_code/src/lib/widget/elm_code_widget_text.c 
b/elm_code/src/lib/widget/elm_code_widget_text.c
index b7b131e..0ae2595 100644
--- a/elm_code/src/lib/widget/elm_code_widget_text.c
+++ b/elm_code/src/lib/widget/elm_code_widget_text.c
@@ -70,6 +70,9 @@ _elm_code_widget_line_text_column_width_to_position(Eo *obj, 
Elm_Code_Widget_Dat
 static unsigned int
 _elm_code_widget_line_text_column_width_get(Eo *obj, Elm_Code_Widget_Data *pd, 
Elm_Code_Line *line)
 {
+   if (!line)
+     return 0;
+
    return _elm_code_widget_line_text_column_width_to_position(obj, pd, line, 
line->length) - 1;
 }
 

-- 


Reply via email to