From 7281c68b271092feeac6f3d56946dbb01d1179e5 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 7 Apr 2012 18:46:10 +0300 Subject: Fix segfault when setting privileges of a non-connected player --- src/server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server.cpp b/src/server.cpp index b33e2477e..d7b55a468 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()); } -- cgit v1.2.3