Skip to content

Commit

Permalink
fix: container is null
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Nov 14, 2022
1 parent 1e24c37 commit 2a0e09b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GZCTF/Controllers/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ public async Task<IActionResult> DeleteContainer([FromRoute] int id, [FromRoute]
StatusCode = 429
};

var destoryId = instance.Container.Id;

if (!await instanceRepository.DestroyContainer(instance.Container, token))
return BadRequest(new RequestResponse("题目删除容器失败"));

Expand All @@ -860,7 +862,7 @@ await gameEventRepository.AddEvent(new()
Content = $"{instance.Challenge.Title}#{instance.Challenge.Id} 销毁容器实例"
}, token);

logger.Log($"{context.Participation!.Team.Name} 销毁题目 {instance.Challenge.Title} 的容器实例 [{instance.Container.Id}]", context.User, TaskStatus.Success);
logger.Log($"{context.Participation!.Team.Name} 销毁题目 {instance.Challenge.Title} 的容器实例 [{destoryId}]", context.User, TaskStatus.Success);

return Ok();
}
Expand Down

0 comments on commit 2a0e09b

Please sign in to comment.