aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/MapField.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/MapField.php
parent43234828da6ae3a3a3ada25d11488fdfd080b79c (diff)
Make PHP c extension work with PHP7 (#2951)
Diffstat (limited to 'php/src/Google/Protobuf/Internal/MapField.php')
-rw-r--r--php/src/Google/Protobuf/Internal/MapField.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/Internal/MapField.php b/php/src/Google/Protobuf/Internal/MapField.php
index 68c10c08..f65bd9b8 100644
--- a/php/src/Google/Protobuf/Internal/MapField.php
+++ b/php/src/Google/Protobuf/Internal/MapField.php
@@ -284,6 +284,9 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
GPBUtil::checkString($value, true);
break;
case GPBType::MESSAGE:
+ if (is_null($value)) {
+ trigger_error("Map element cannot be null.", E_USER_ERROR);
+ }
GPBUtil::checkMessage($value, $this->klass);
break;
default: