Skip to content

Commit 582b7f9

Browse files
committed
fix: Nullability
1 parent ee85992 commit 582b7f9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/LinkDotNet.Blog.Web/Features/Components/UploadFileModalDialogObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ namespace LinkDotNet.Blog.Web.Features.Components;
55
public class UploadFileModalDialogObject
66
{
77
[Required]
8-
public string Name { get; set; }
8+
[MinLength(1)]
9+
public string Name { get; set; } = string.Empty;
910

1011
public bool CacheMedia { get; set; } = true;
1112
}

src/LinkDotNet.Blog.Web/Features/Services/FileUpload/AzureBlobStorageService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.IO;
33
using System.Threading.Tasks;
4-
using System.Web;
54
using Azure.Identity;
65
using Azure.Storage.Blobs;
76
using Azure.Storage.Blobs.Models;
@@ -20,6 +19,8 @@ public AzureBlobStorageService(IOptions<UploadConfiguration> azureBlobStorageCon
2019

2120
public async Task<string> UploadFileAsync(string fileName, Stream fileStream, UploadOptions options)
2221
{
22+
ArgumentNullException.ThrowIfNull(options);
23+
2324
var containerName = azureBlobStorageConfiguration.Value.ContainerName;
2425
var client = CreateClient(azureBlobStorageConfiguration.Value);
2526
var blobContainerClient = client.GetBlobContainerClient(containerName);

0 commit comments

Comments
 (0)