 src/bp-core/bp-core-avatars.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bp-core/bp-core-avatars.php b/src/bp-core/bp-core-avatars.php
index 5eb8823e6..fbb1a027e 100644
--- a/src/bp-core/bp-core-avatars.php
+++ b/src/bp-core/bp-core-avatars.php
@@ -192,6 +192,11 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
 function bp_core_fetch_avatar( $args = '' ) {
 	$bp = buddypress();
 
+	// If $bp->avatar doesn't exist yet, bail.
+	if ( ! $bp->avatar ) {
+		return;
+	}
+
 	// If avatars are disabled for the root site, obey that request and bail.
 	if ( ! $bp->avatar->show_avatars ) {
 		return;
