Skip to content
Snippets Groups Projects
Commit b42ce6c3 authored by Robin Appelman's avatar Robin Appelman
Browse files

Prevent error if previously cached data doesn't have an etag

parent 3821a096
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
$server->addPlugin(new OC_Connector_Sabre_QuotaPlugin($view));
$server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin());
$server->debugExceptions = true;
// And off we go!
if ($body) {
......
......@@ -115,11 +115,12 @@ class Scanner extends BasicEmitter {
}
if ($reuseExisting) {
// prevent empty etag
$etag = $cacheData['etag'];
$propagateETagChange = false;
if (empty($etag)) {
if (empty($cacheData['etag'])) {
$etag = $data['etag'];
$propagateETagChange = true;
} else {
$etag = $cacheData['etag'];
$propagateETagChange = false;
}
// only reuse data if the file hasn't explicitly changed
if (isset($data['storage_mtime']) && isset($cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment