chore: check if import zip contains a VERSION file

This commit is contained in:
kolaente 2024-01-14 22:21:55 +01:00
parent 514ea71d93
commit ec6e3e99e0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,9 @@ func (v *FileMigrator) Migrate(user *user.User, file io.ReaderAt, size int64) er
//////
// Check if we're able to import this dump
if versionFile == nil {
return fmt.Errorf("dump does not seem to contain a version file")
}
vf, err := versionFile.Open()
if err != nil {
return fmt.Errorf("could not open version file: %w", err)