Permalink
Browse files

Read vault node only if net operation was successful

  • Loading branch information...
1 parent 11ad05f commit ff4c88e8426bdaa0dcbd0f920eab200a94a052c7 @boq boq committed Sep 30, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 net/auth/pnAuthClient.cpp
@@ -152,9 +152,11 @@ bool pnAuthClient::Dispatch::dispatch(pnSocket* sock)
break;
case kAuth2Cli_VaultNodeFetched:
{
+ ENetError result = (ENetError)msgbuf[1].fUint;
pnVaultNode node;
- node.read(msgbuf[3].fData, msgbuf[2].fUint);
- fReceiver->onVaultNodeFetched(msgbuf[0].fUint, (ENetError)msgbuf[1].fUint, node);
+ if (result == kNetSuccess)
+ node.read(msgbuf[3].fData, msgbuf[2].fUint);
+ fReceiver->onVaultNodeFetched(msgbuf[0].fUint, result, node);
}
break;
case kAuth2Cli_VaultNodeChanged:

0 comments on commit ff4c88e

Please sign in to comment.