aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/MapField.php
diff options
context:
space:
mode:
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: