From 190b5270c8717ca343db42da489e5e7d6d9efb2c Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 19 Apr 2017 16:23:51 -0700 Subject: Make PHP c extension work with PHP7 (#2951) --- php/src/Google/Protobuf/Internal/RepeatedField.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'php/src/Google/Protobuf/Internal/RepeatedField.php') diff --git a/php/src/Google/Protobuf/Internal/RepeatedField.php b/php/src/Google/Protobuf/Internal/RepeatedField.php index 0dc5d9d2..2ad4709a 100644 --- a/php/src/Google/Protobuf/Internal/RepeatedField.php +++ b/php/src/Google/Protobuf/Internal/RepeatedField.php @@ -225,6 +225,10 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable GPBUtil::checkString($value, true); break; case GPBType::MESSAGE: + if (is_null($value)) { + trigger_error("RepeatedField element cannot be null.", + E_USER_ERROR); + } GPBUtil::checkMessage($value, $this->klass); break; default: -- cgit v1.2.3