diff options
Diffstat (limited to 'php/src/Google/Protobuf/descriptor.php')
-rw-r--r-- | php/src/Google/Protobuf/descriptor.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/descriptor.php b/php/src/Google/Protobuf/descriptor.php index ef6b9dcf..9e56ef27 100644 --- a/php/src/Google/Protobuf/descriptor.php +++ b/php/src/Google/Protobuf/descriptor.php @@ -155,7 +155,11 @@ class Descriptor public function getFieldByNumber($number) { + if (!isset($this->field[$number])) { + return NULL; + } else { return $this->field[$number]; + } } public function setClass($klass) |