fix: fix crash in API v1 when message.System is null
This commit is contained in:
parent
f08524ee19
commit
6d1fd0e267
@ -26,6 +26,7 @@ public class MessageController: ControllerBase
|
|||||||
var msg = await _db.Execute(c => _repo.GetMessage(c, mid));
|
var msg = await _db.Execute(c => _repo.GetMessage(c, mid));
|
||||||
if (msg == null) return NotFound("Message not found.");
|
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…
Reference in New Issue
Block a user