diff options
author | crupest <crupest@outlook.com> | 2021-02-12 16:42:56 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-12 16:42:56 +0800 |
commit | e407b645aa7c6738c6f37c69f616c91c99bf1af0 (patch) | |
tree | 1133f585e91fd3b8419c24b39ba44bc4042a7709 /BackEnd/Timeline/Controllers/TimelinePostController.cs | |
parent | 58595b5c6462add8224904c833adc9eb9d64bb8b (diff) | |
download | timeline-e407b645aa7c6738c6f37c69f616c91c99bf1af0.tar.gz timeline-e407b645aa7c6738c6f37c69f616c91c99bf1af0.tar.bz2 timeline-e407b645aa7c6738c6f37c69f616c91c99bf1af0.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Controllers/TimelinePostController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/TimelinePostController.cs | 4 |
1 files changed, 4 insertions, 0 deletions
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);
|