Skip to content

Commit 55c1537

Browse files
committed
Ignore missing signature on v2 endpoint when the metadata is not in v2
Signed-off-by: Louis Chemineau <[email protected]>
1 parent 31e04bd commit 55c1537

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/MetaDataStorage.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,19 @@ private function writeSignature(ISimpleFolder $dir, string $filename, string $si
234234
public function readSignature(int $id): string {
235235
$folderName = $this->getFolderNameForFileId($id);
236236
$dir = $this->appData->getFolder($folderName);
237-
return $dir->getFile($this->metaDataSignatureFileName)->getContent();
237+
238+
try {
239+
return $dir->getFile($this->metaDataSignatureFileName)->getContent();
240+
} catch (NotFoundException $ex) {
241+
$metadata = $dir->getFile($this->metaDataFileName)->getContent();
242+
$decodedMetadata = json_decode($metadata, true);
243+
244+
if ($decodedMetadata['metadata']['version'] === "1.2") {
245+
return "";
246+
}
247+
248+
throw $ex;
249+
}
238250
}
239251

240252
/**

0 commit comments

Comments
 (0)