Skip to content

Commit

Permalink
Short-circuit when there's no code
Browse files Browse the repository at this point in the history
  • Loading branch information
iansltx committed Mar 16, 2017
1 parent 1693538 commit c843880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$qs = $req->getQueryParams();
$code = $qs['text'];

if ($rs->recordEntry($code, $qs['msisdn'])) {
if ($code && $rs->recordEntry($code, $qs['msisdn'])) {
$this->sms->send($qs['msisdn'], 'Your entry into ' . $rs->getNameByCode($code) . ' has been received!');
}
return $res->withStatus(200, "OK")->write('Message received.');
Expand Down

0 comments on commit c843880

Please sign in to comment.