From 924e31aad5eced73772b9b561a63dfa1814bfe80 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 15 Aug 2025 16:46:08 +0800 Subject: [PATCH] :bug: Trying to fix chat invite --- DysonNetwork.Sphere/Chat/ChatRoomController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DysonNetwork.Sphere/Chat/ChatRoomController.cs b/DysonNetwork.Sphere/Chat/ChatRoomController.cs index e59208a..bc6191c 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoomController.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoomController.cs @@ -164,7 +164,7 @@ public class ChatRoomController( public class ChatRoomRequest { - [Required] [MaxLength(1024)] public string? Name { get; set; } + [Required][MaxLength(1024)] public string? Name { get; set; } [MaxLength(4096)] public string? Description { get; set; } [MaxLength(32)] public string? PictureId { get; set; } [MaxLength(32)] public string? BackgroundId { get; set; } @@ -576,7 +576,7 @@ public class ChatRoomController( Status = -100 }); - if (relationship != null && relationship.Relationship.Status == -100) + if (relationship?.Relationship != null && relationship.Relationship.Status == -100) return StatusCode(403, "You cannot invite a user that blocked you."); var chatRoom = await db.ChatRooms @@ -985,4 +985,4 @@ public class ChatRoomController( } ); } -} \ No newline at end of file +}