diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 0acb7265e36..8bb6828fa60 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -633,8 +633,8 @@ void LineEdit::_notification(int p_what) { if (char_ofs >= t.length()) break; - CharType cchar = pass ? '*' : t[char_ofs]; - CharType next = pass ? '*' : t[char_ofs + 1]; + CharType cchar = (pass && !text.empty()) ? '*' : t[char_ofs]; + CharType next = (pass && !text.empty()) ? '*' : t[char_ofs + 1]; int char_width = font->get_char_size(cchar, next).width; // end of widget, break!