diff --git a/dokan.php b/dokan.php index cf43e0e311..33a146f247 100755 --- a/dokan.php +++ b/dokan.php @@ -144,14 +144,12 @@ public static function init() { * * @param $prop * - * @return mixed + * @return Class Instance */ public function __get( $prop ) { if ( array_key_exists( $prop, $this->container ) ) { return $this->container[ $prop ]; } - - return $this->{$prop}; } /** diff --git a/includes/functions.php b/includes/functions.php index 6c5464cce0..283b141c6f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -2008,7 +2008,13 @@ function dokan_get_avatar_url( $url, $id_or_email, $args ) { return $url; } - $vendor = dokan()->vendor->get( $user->ID ); + $vendor = dokan()->vendor; + + if ( ! $vendor ) { + return $url; + } + + $vendor = $vendor->get( $user->ID ); $gravatar_id = $vendor->get_avatar_id(); if ( ! $gravatar_id ) {