File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -9,25 +9,33 @@ class TextDisplayImpl extends TextBase {
99
1010 private override function get_selectionStartIndex (): Int {
1111 var textCtrl : hx.widgets. TextCtrl = cast (this .parentComponent .window , hx.widgets. TextCtrl );
12+ if (textCtrl == null ) return 0 ;
13+
1214 return textCtrl .selection .start ;
1315 }
1416
1517 private override function set_selectionStartIndex (value : Int ): Int {
1618 var textCtrl : hx.widgets. TextCtrl = cast (this .parentComponent .window , hx.widgets. TextCtrl );
17- var endIndex = selectionEndIndex < value ? value : selectionEndIndex ; // otherwise hxWigets changes start to end
19+ if (textCtrl == null ) return 0 ;
20+
21+ var endIndex = selectionEndIndex < value ? value : selectionEndIndex ; // otherwise hxWigets changes start to end
1822 textCtrl .selection = {start : value , end : endIndex };
1923 return value ;
2024 }
2125
2226
2327 private override function get_selectionEndIndex (): Int {
2428 var textCtrl : hx.widgets. TextCtrl = cast (this .parentComponent .window , hx.widgets. TextCtrl );
29+ if (textCtrl == null ) return 0 ;
30+
2531 return textCtrl .selection .end ;
2632 }
2733
2834 private override function set_selectionEndIndex (value : Int ): Int {
2935 var textCtrl : hx.widgets. TextCtrl = cast (this .parentComponent .window , hx.widgets. TextCtrl );
30- textCtrl .selection = {start : selectionStartIndex , end : value };
36+ if (textCtrl == null ) return 0 ;
37+
38+ textCtrl .selection = {start : selectionStartIndex , end : value };
3139 return value ;
3240 }
3341}
You can’t perform that action at this time.
0 commit comments