From 7281c68b271092feeac6f3d56946dbb01d1179e5 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 7 Apr 2012 18:46:10 +0300 Subject: [PATCH] Fix segfault when setting privileges of a non-connected player --- src/server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()); } -- 2.30.2