133c133,134 < throw new \UnexpectedValueException('Supplied file object type ' . get_class($image) . ' for ' . $src . ' must be File or FileReference.', 1382687163); --- > //Before getting the class name, check if it actually is an object and that it is not null. > throw new \UnexpectedValueException('Supplied file object type ' . is_object($image) AND $image != null ? get_class($image) : 'null' . ' for ' . $src . ' must be File or FileReference.', 1382687163);