From e407b645aa7c6738c6f37c69f616c91c99bf1af0 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 12 Feb 2021 16:42:56 +0800 Subject: ... --- BackEnd/Timeline/Controllers/TimelinePostController.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'BackEnd/Timeline') diff --git a/BackEnd/Timeline/Controllers/TimelinePostController.cs b/BackEnd/Timeline/Controllers/TimelinePostController.cs index 06082f0f..6904e28d 100644 --- a/BackEnd/Timeline/Controllers/TimelinePostController.cs +++ b/BackEnd/Timeline/Controllers/TimelinePostController.cs @@ -171,6 +171,10 @@ namespace Timeline.Controllers for (int i = 0; i < body.DataList.Count; i++) { var data = body.DataList[i]; + + if (data is null) + return BadRequest(new CommonResponse(ErrorCodes.Common.InvalidModel, $"Data at index {i} is null.")); + try { var d = Convert.FromBase64String(data.Data); -- cgit v1.2.3