diff --git a/SilMock/Google/Service/Directory/VerificationCodesResource.php b/SilMock/Google/Service/Directory/VerificationCodesResource.php index ac4da65..fc19910 100644 --- a/SilMock/Google/Service/Directory/VerificationCodesResource.php +++ b/SilMock/Google/Service/Directory/VerificationCodesResource.php @@ -79,12 +79,14 @@ public function listVerificationCodes($userKey) $key, $userKey ); - $verificationCodeData = $data[0]['data']; - $decodedVerificationCodeData = json_decode($verificationCodeData, true); - unset($decodedVerificationCodeData['primaryEmail']); - $verificationCodes = new \Google_Service_Directory_VerificationCodes(); - ObjectUtils::initialize($verificationCodes, $decodedVerificationCodeData['data']); + if (! empty($data)) { + $verificationCodeData = $data[0]['data']; + $decodedVerificationCodeData = json_decode($verificationCodeData, true); + unset($decodedVerificationCodeData['primaryEmail']); + + ObjectUtils::initialize($verificationCodes, $decodedVerificationCodeData['data']); + } return $verificationCodes; }