X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..a2c6537e60ab5564d6bf33bb14ac8c42744aa93c:/src/univ/textctrl.cpp

diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp
index b07df4b00e..3b15ef1070 100644
--- a/src/univ/textctrl.cpp
+++ b/src/univ/textctrl.cpp
@@ -1648,6 +1648,9 @@ wxString wxTextCtrl::GetLineText(wxTextCoord line) const
     }
     else // multiline
     {
+        //this is called during DoGetBestSize
+        if (line == 0 && GetLineCount() == 0) return wxEmptyString ;
+       
         wxCHECK_MSG( (size_t)line < GetLineCount(), _T(""),
                      _T("line index out of range") );