diff --git a/src/DeepLTranslator.php b/src/DeepLTranslator.php index c686db5..6f59a42 100644 --- a/src/DeepLTranslator.php +++ b/src/DeepLTranslator.php @@ -115,7 +115,7 @@ public function result(int $type = self::TYPE_FORMAT) return [ 'status' => self::ERROR, 'code' => $error['code'], - 'message' => sprintf('%s,what:%s', $error['message'], $error['data']['what']), 'data' => [], + 'message' => sprintf('%s,what:%s', $error['message'] ?? '', $error['data']['what'] ?? ''), 'data' => [], ]; }