handle invalid results from mount providers

This commit is contained in:
Robin Appelman 2015-06-29 14:42:14 +02:00
parent abb0c728ef
commit 8a2ef26b5e
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@ class MountProviderCollection implements IMountProviderCollection, Emitter {
$mounts = array_map(function (IMountProvider $provider) use ($user, $loader) {
return $provider->getMountsForUser($user, $loader);
}, $this->providers);
return array_reduce($mounts, function ($mounts, $providerMounts) {
$mounts = array_filter($mounts, function ($result) {
return is_array($result);
});
return array_reduce($mounts, function (array $mounts, array $providerMounts) {
return array_merge($mounts, $providerMounts);
}, array());
}