mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: fix crash in API v1 when message.System is null
This commit is contained in:
parent
f08524ee19
commit
6d1fd0e267
1 changed files with 2 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ public class MessageController: ControllerBase
|
|||
var msg = await _db.Execute(c => _repo.GetMessage(c, mid));
|
||||
if (msg == null) return NotFound("Message not found.");
|
||||
|
||||
return msg.ToJson(User.ContextFor(msg.System), APIVersion.V1);
|
||||
var ctx = msg.System == null ? LookupContext.ByNonOwner : User.ContextFor(msg.System);
|
||||
return msg.ToJson(ctx, APIVersion.V1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue