From 0598470942cc9e6bf72d2ed5d04c3c31c1ed95c1 Mon Sep 17 00:00:00 2001 From: Kai Philipp Date: Fri, 13 Sep 2019 17:49:30 +0200 Subject: [PATCH] NULL check --- src/net/common/serverlobbythread.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 213c9c50..feb22b93 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1814,10 +1814,9 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData LOG_ERROR("last_games from db = " << dbPlayerData.last_games); std::vector last_games; std::stringstream ss(dbPlayerData.last_games); - for (i; ss >> i;) { - long il = stol(i); - if(il > 0) - last_games.push_back(il); + for (string i; ss >> i;) { + if(i.length() > 0) + last_games.push_back(stol(i)); if (ss.peek() == ',') ss.ignore(); }