Fix/improve dereference-before-null-checks.

This commit is contained in:
Jon Siwek 2013-09-13 16:41:41 -05:00
parent 3d81432a1e
commit 735d2c402a
8 changed files with 19 additions and 30 deletions

View file

@ -2925,8 +2925,7 @@ void RemoteSerializer::GotID(ID* id, Val* val)
const char* desc = val->AsString()->CheckString();
current_peer->val->Assign(4, new StringVal(desc));
Log(LogInfo, fmt("peer_description is %s",
(desc && *desc) ? desc : "not set"),
Log(LogInfo, fmt("peer_description is %s", *desc ? desc : "not set"),
current_peer);
Unref(id);