Check that some things exist before trying to use them

This commit is contained in:
nathangray 2021-03-05 09:30:02 -07:00
parent 95f84454be
commit 8063d65303

View File

@ -1213,7 +1213,7 @@ abstract class Merge
} }
// Look for numbers, set their value if needed // Look for numbers, set their value if needed
if($this->numeric_fields || count($names)) if(property_exists($this,'numeric_fields') || count($names))
{ {
foreach((array)$this->numeric_fields as $fieldname) { foreach((array)$this->numeric_fields as $fieldname) {
$names[] = preg_quote($fieldname,'/'); $names[] = preg_quote($fieldname,'/');
@ -1573,6 +1573,10 @@ abstract class Merge
try try
{ {
$classname = "{$app}_merge"; $classname = "{$app}_merge";
if(!class_exists($classname))
{
return $replacements;
}
$class = new $classname(); $class = new $classname();
$method = $app.'_replacements'; $method = $app.'_replacements';
if(method_exists($class,$method)) if(method_exists($class,$method))