aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/RepeatedField.php
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-04-19 16:23:51 -0700
committerGravatar GitHub <noreply@github.com>2017-04-19 16:23:51 -0700
commit190b5270c8717ca343db42da489e5e7d6d9efb2c (patch)
tree3815f20268bc56aac88267004149f9e4eb634223 /php/src/Google/Protobuf/Internal/RepeatedField.php
parent43234828da6ae3a3a3ada25d11488fdfd080b79c (diff)
Make PHP c extension work with PHP7 (#2951)
Diffstat (limited to 'php/src/Google/Protobuf/Internal/RepeatedField.php')
-rw-r--r--php/src/Google/Protobuf/Internal/RepeatedField.php4
1 files changed, 4 insertions, 0 deletions
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: