Update Object.php

Check to ensure `self::$extra_methods[$this->class][$method]` exists before trying to retrieve it. Prevents a bunch of notices from being generated.
This commit is contained in:
Joe Chenevey 2019-01-08 15:02:22 -05:00 committed by GitHub
parent 214c6ddb8e
commit 02e31932f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -908,12 +908,14 @@ abstract class SS_Object {
$methods = $this->findMethodsFromExtension($extension); $methods = $this->findMethodsFromExtension($extension);
if ($methods) { if ($methods) {
foreach ($methods as $method) { foreach ($methods as $method) {
if (isset(self::$extra_methods[$this->class][$method])) {
$methodInfo = self::$extra_methods[$this->class][$method]; $methodInfo = self::$extra_methods[$this->class][$method];
if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) { if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) {
unset(self::$extra_methods[$this->class][$method]); unset(self::$extra_methods[$this->class][$method]);
} }
} }
}
if (empty(self::$extra_methods[$this->class])) { if (empty(self::$extra_methods[$this->class])) {
unset(self::$extra_methods[$this->class]); unset(self::$extra_methods[$this->class]);