Skip to content

Commit

Permalink
Убрано безпричинное бросение исключения (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezoterik authored Sep 12, 2020
1 parent af8a76c commit 930245b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Delivery/NovaPoshtaApi2.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private function prepare($data)
? $data
: json_decode($data, true);
// If error exists, throw Exception
if ($this->throwErrors and array_key_exists('errors', $result)) {
if ($this->throwErrors and array_key_exists('errors', $result) and $result['errors']) {
throw new \Exception(is_array($result['errors']) ? implode("\n", $result['errors']) : $result['errors']);
}
return $result;
Expand Down

0 comments on commit 930245b

Please sign in to comment.