diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2025-01-29 11:26:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-29 11:26:23 +0100 |
commit | c1cd784c8937a4ce3419f8b5d2d7652c984b863b (patch) | |
tree | 9cb1dc04579757931fe5b2d760affb1e8f21c4cc | |
parent | 3dec77b7d235a624dfee6d245f18fe0f731536f7 (diff) | |
parent | 67e0ef5b72ecfa92bdee0808fc12a809e9e17980 (diff) | |
download | nextcloud-server-c1cd784c8937a4ce3419f8b5d2d7652c984b863b.tar.gz nextcloud-server-c1cd784c8937a4ce3419f8b5d2d7652c984b863b.zip |
Merge pull request #50437 from nextcloud/fix/encoding-wrapper-scanner-stable30
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encoding.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/EncodingTest.php | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php index 11f21eb828e..caaba22b05f 100644 --- a/lib/private/Files/Storage/Wrapper/Encoding.php +++ b/lib/private/Files/Storage/Wrapper/Encoding.php @@ -510,7 +510,9 @@ class Encoding extends Wrapper { public function getMetaData($path) { $entry = $this->storage->getMetaData($this->findPathToUse($path)); - $entry['name'] = trim(Filesystem::normalizePath($entry['name']), '/'); + if ($entry !== null) { + $entry['name'] = trim(Filesystem::normalizePath($entry['name']), '/'); + } return $entry; } diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php index ae6a6ece742..b50d6f985f1 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -240,4 +240,12 @@ class EncodingTest extends \Test\Files\Storage\Storage { $entry = $this->instance->getMetaData('/test/' . self::NFD_NAME); $this->assertEquals(self::NFC_NAME, $entry['name']); } + + /** + * Regression test of https://github.com/nextcloud/server/issues/50431 + */ + public function testNoMetadata() { + $this->assertNull($this->instance->getMetaData('/test/null')); + } + } |