diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php index 9ff525b..43532a0 100644 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php @@ -120,7 +120,10 @@ public function __construct(ModuleHandlerInterface $module_handler) { * $filter are returned. */ public function getWrappers($filter = StreamWrapperInterface::ALL) { - if (!isset($this->wrappers[$filter])) { + if (isset($this->wrappers[$filter])) { + return $this->wrappers[$filter]; + } + else if (isset($this->wrappers[StreamWrapperInterface::ALL])) { $this->wrappers[$filter] = array(); foreach ($this->wrappers[StreamWrapperInterface::ALL] as $scheme => $info) { // Bit-wise filter. @@ -128,9 +131,11 @@ public function getWrappers($filter = StreamWrapperInterface::ALL) { $this->wrappers[$filter][$scheme] = $info; } } + return $this->wrappers[$filter]; + } + else { + return array(); } - - return $this->wrappers[$filter]; } /**