From f1b82c1b06604c2c1eed750a6c980aa0b5355560 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 11 Oct 2013 14:48:19 +0300 Subject: First part of checks from Parasoft C++ Test. --- src/gui/windows/debugwindow.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/debugwindow.cpp') diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index 90a8fccd6..24a77a402 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -531,9 +531,17 @@ NetDebugTab::NetDebugTab(const Widget2 *const widget) : void NetDebugTab::logic() { BLOCK_START("NetDebugTab::logic") - // TRANSLATORS: debug window label - mPingLabel->setCaption(strprintf(_("Ping: %s ms"), - player_node->getPingTime().c_str())); + if (player_node) + { + // TRANSLATORS: debug window label + mPingLabel->setCaption(strprintf(_("Ping: %s ms"), + player_node->getPingTime().c_str())); + } + else + { + // TRANSLATORS: debug window label + mPingLabel->setCaption(strprintf(_("Ping: %s ms"), "0")); + } // TRANSLATORS: debug window label mInPackets1Label->setCaption(strprintf(_("In: %d bytes/s"), PacketCounters::getInBytes())); -- cgit v1.2.3-60-g2f50