summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/characterdisplay.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index 1815ec395..de0306f7c 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -114,7 +114,11 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event)
int mouseX = 0;
int mouseY = 0;
SDL_GetMouseState(&mouseX, &mouseY);
- mPopup->show(mouseX, mouseY, mName->getCaption());
+ const std::string &name = mName->getCaption();
+ if (!name.empty())
+ mPopup->show(mouseX, mouseY, name);
+ else
+ mPopup->setVisible(false);
}
void CharacterDisplay::mousePressed(gcn::MouseEvent &event)