summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/browserbox.cpp6
-rw-r--r--src/net/tmwa/adminhandler.cpp8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 314429fa..d553312b 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -280,7 +280,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
- if (mSelectedLink >= 0)
+ if (mSelectedLink >= 0 && (unsigned) mSelectedLink < mLinks.size())
{
if ((mHighMode & BACKGROUND))
{
@@ -326,7 +326,7 @@ int BrowserBox::calcHeight()
{
int x = 0, y = 0;
int wrappedLines = 0;
- int link = 0;
+ unsigned link = 0;
gcn::Font *font = getFont();
int fontHeight = font->getHeight();
@@ -423,7 +423,7 @@ int BrowserBox::calcHeight()
}
}
- if (c == '<')
+ if (c == '<' && link < mLinks.size())
{
const int size =
font->getWidth(mLinks[link].caption) + 1;
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 2795df8a..53e4bfd8 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -68,9 +68,11 @@ void AdminHandler::handleMessage(Net::MessageIn &msg)
case SMSG_ADMIN_IP:
id = msg.readInt32();
int ip = msg.readInt32();
- Being *player = actorSpriteManager->findBeing(id);
- player->setIp(ip);
- player->updateName();
+ if (Being *player = actorSpriteManager->findBeing(id))
+ {
+ player->setIp(ip);
+ player->updateName();
+ }
break;
}
}