diff options
Diffstat (limited to 'src/gui/windows/textdialog.cpp')
-rw-r--r-- | src/gui/windows/textdialog.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/windows/textdialog.cpp b/src/gui/windows/textdialog.cpp index 442cd5c67..f72f60d4e 100644 --- a/src/gui/windows/textdialog.cpp +++ b/src/gui/windows/textdialog.cpp @@ -36,6 +36,11 @@ int TextDialog::instances = 0; +namespace +{ + const std::string emptyStr; +} // namespace + TextDialog::TextDialog(const std::string &restrict title, const std::string &restrict msg, Window *const parent, @@ -110,15 +115,16 @@ const std::string &TextDialog::getText() const { if (mTextField) return mTextField->getText(); - else + else if (mPasswordField) return mPasswordField->getText(); + return emptyStr; } void TextDialog::setText(const std::string &text) { if (mTextField) mTextField->setText(text); - else + else if (mPasswordField) mPasswordField->setText(text); } |