[backend/masto-client] Fix NullReferenceExceptions in StatusController
This commit is contained in:
parent
4dd5eea946
commit
6c2215e30d
1 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ public class StatusController(
|
||||||
.FirstOrDefaultAsync() ??
|
.FirstOrDefaultAsync() ??
|
||||||
throw GracefulException.RecordNotFound();
|
throw GracefulException.RecordNotFound();
|
||||||
|
|
||||||
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.User.IsRemoteUser && user == null)
|
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.UserHost != null && user == null)
|
||||||
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
||||||
|
|
||||||
var shouldShowContext = await db.Notes
|
var shouldShowContext = await db.Notes
|
||||||
|
@ -550,7 +550,7 @@ public class StatusController(
|
||||||
.FirstOrDefaultAsync() ??
|
.FirstOrDefaultAsync() ??
|
||||||
throw GracefulException.RecordNotFound();
|
throw GracefulException.RecordNotFound();
|
||||||
|
|
||||||
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.User.IsRemoteUser && user == null)
|
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.UserHost != null && user == null)
|
||||||
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
||||||
|
|
||||||
var res = await db.NoteLikes.Where(p => p.Note == note)
|
var res = await db.NoteLikes.Where(p => p.Note == note)
|
||||||
|
@ -578,7 +578,7 @@ public class StatusController(
|
||||||
.FirstOrDefaultAsync() ??
|
.FirstOrDefaultAsync() ??
|
||||||
throw GracefulException.RecordNotFound();
|
throw GracefulException.RecordNotFound();
|
||||||
|
|
||||||
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.User.IsRemoteUser && user == null)
|
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.UserHost != null && user == null)
|
||||||
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
throw GracefulException.Forbidden("Public preview is disabled on this instance");
|
||||||
|
|
||||||
var res = await db.Notes
|
var res = await db.Notes
|
||||||
|
|
Loading…
Add table
Reference in a new issue