diff --git wp-includes/plugin.php wp-includes/plugin.php
index 7eba1bb..3587d6d 100644
--- wp-includes/plugin.php
+++ wp-includes/plugin.php
@@ -619,9 +619,11 @@ function remove_all_actions($tag, $priority = false) {
 function plugin_basename( $file ) {
 	global $wp_plugin_paths;
 
-	foreach ( $wp_plugin_paths as $dir => $realdir ) {
-		if ( strpos( $file, $realdir ) === 0 ) {
-			$file = $dir . substr( $file, strlen( $realdir ) );
+	if (!is_null($wp_plugin_paths)) {
+		foreach ( $wp_plugin_paths as $dir => $realdir ) {
+			if ( strpos( $file, $realdir ) === 0 ) {
+				$file = $dir . substr( $file, strlen( $realdir ) );
+			}
 		}
 	}
 
