Skip to content

Commit

Permalink
fixed a bug that call Trying to get property of non-object
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaoming committed Jan 3, 2020
1 parent 2122ab8 commit 6889b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Bryce/OpenApi/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ public function send(string $to, string $subject, string $body, string $from = n

$res = Tools::dealCurlResult($res);

if ($res->status == Error::_OK) {
if ($res->code == Error::_OK) {
return true;
} else {
throw new MailException($res->msg, $res->status);
return false;
throw new MailException($res->msg, $res->code);
}
}
}
4 changes: 2 additions & 2 deletions src/Bryce/OpenApi/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public function verifyCode(string $mobile, int $code)

$res = Tools::dealCurlResult($res);

if ($res->status == Error::_OK) {
if ($res->code == Error::_OK) {
return true;
} else {
throw new SmsException($res->msg, $res->status);
throw new SmsException($res->msg, $res->code);
}
}
}

0 comments on commit 6889b2c

Please sign in to comment.