diff --git src/wp-includes/ms-blogs.php src/wp-includes/ms-blogs.php
index e1c70e1..11f9cb1 100644
--- src/wp-includes/ms-blogs.php
+++ src/wp-includes/ms-blogs.php
@@ -37,7 +37,7 @@ function wpmu_update_blogs_date() {
  */
 function get_blogaddress_by_id( $blog_id ) {
 	$bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
-	return esc_url( 'http://' . $bloginfo->domain . $bloginfo->path );
+	return isset( $bloginfo->domain ) && isset( $bloginfo->path ) ?  esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
 }
 
 /**
diff --git tests/phpunit/tests/multisite/site.php tests/phpunit/tests/multisite/site.php
index 3dafbee..c82453e 100644
--- tests/phpunit/tests/multisite/site.php
+++ tests/phpunit/tests/multisite/site.php
@@ -877,6 +877,26 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
 		$this->assertFalse( $site );
 	}
 
+
+	/**
+	 * Tests returning an address for both invalid and valid ids and that the appropriate responses occur.
+	 *
+	 */
+	function test_get_blogaddress_by_id() {
+		$user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+		$blog_id = $this->factory->blog->create( array( 'user_id' => $user_id,  'path' => '/testdomainexists', 'title' => 'Test Title' ) );
+
+		// Test valid id.
+		$blogaddress = get_blogaddress_by_id( $blog_id );
+		$this->assertEquals( $blogaddress,  'http://example.org/testdomainexists/' );
+
+		//Test invalid id.
+		$invalidblogaddress = get_blogaddress_by_id( 999 );
+		$this->assertEquals( $invalidblogaddress, '' );
+	}
+
+
+
 	/**
 	 * Test the original and cached responses for a created and then deleted site when
 	 * the blog ID is requested through get_blog_id_from_url().
@@ -1121,4 +1141,4 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
 	}
 }
 
-endif;
\ No newline at end of file
+endif;
