From 753cc63d96ceab60f49547b382c36f96ac42a141 Mon Sep 17 00:00:00 2001 From: buergi Date: Sat, 8 Sep 2018 15:17:02 +0200 Subject: [PATCH] webdav: add workaround for missing mtime - fixes #2420 --- backend/webdav/api/types.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.go index 983825418..7ee435b2c 100644 --- a/backend/webdav/api/types.go +++ b/backend/webdav/api/types.go @@ -155,6 +155,12 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { return err } + // If time is missing then return the epoch + if v == "" { + *t = Time(time.Unix(0, 0)) + return nil + } + // Parse the time format in multiple possible ways var newT time.Time for _, timeFormat := range timeFormats {