diff --git a/DysonNetwork.Drive/Storage/FileService.cs b/DysonNetwork.Drive/Storage/FileService.cs index 14de1f2..3c990e8 100644 --- a/DysonNetwork.Drive/Storage/FileService.cs +++ b/DysonNetwork.Drive/Storage/FileService.cs @@ -161,7 +161,7 @@ public class FileService( /// private async Task ExtractMetadataAsync(CloudFile file, string filePath, Stream stream) { - switch (file.MimeType.Split('/')[0]) + switch (file.MimeType?.Split('/')[0]) { case "image": try @@ -201,6 +201,7 @@ public class FileService( } catch (Exception ex) { + file.FileMeta = new Dictionary(); logger.LogError(ex, "Failed to analyze image file {FileId}", file.Id); }