From: Perttu Ahola Date: Sat, 7 Apr 2012 15:46:10 +0000 (+0300) Subject: Fix segfault when setting privileges of a non-connected player X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=7281c68b271092feeac6f3d56946dbb01d1179e5;p=zefram%2Fminetest%2Fminetest_engine.git Fix segfault when setting privileges of a non-connected player --- diff --git a/src/server.cpp b/src/server.cpp index b33e2477..d7b55a46 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4322,7 +4322,10 @@ void Server::reportPrivsModified(const std::string &name) if(!player) return; SendPlayerPrivileges(player->peer_id); - player->getPlayerSAO()->updatePrivileges( + PlayerSAO *sao = player->getPlayerSAO(); + if(!sao) + return; + sao->updatePrivileges( getPlayerEffectivePrivs(name), isSingleplayer()); }