fix: resolve nullable dereference warnings in list/detail pages
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
job.Status is EJobStatus.Queued or EJobStatus.Running or EJobStatus.Waiting
|
||||
);
|
||||
if (shouldFetch) {
|
||||
var (children, since) = await FetchChildren(job.Id, null);
|
||||
var (children, since) = await FetchChildren!(job.Id, null);
|
||||
_childrenCache[job.Id] = children;
|
||||
_sinceTimestamps[job.Id] = since ?? DateTime.UtcNow;
|
||||
}
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
// Level 0: poll children for all active roots (segment progress update)
|
||||
if (Level == 0 && FetchChildren is not null) {
|
||||
foreach (var root in Roots) {
|
||||
foreach (var root in Roots!) {
|
||||
if (root.Status is EJobStatus.Queued or EJobStatus.Running or EJobStatus.Waiting) {
|
||||
hasActive = true;
|
||||
visited.Add(root.Id);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-2 mt-1">
|
||||
@if (!string.IsNullOrEmpty(album.PersonName) && album.Person.HasValue) {
|
||||
@if (!string.IsNullOrEmpty(album!.PersonName) && album.Person.HasValue) {
|
||||
<a class="album-cosplayer-link" href="/cosplayer/@album.Person.Value">@album.PersonName</a>
|
||||
}
|
||||
<span class="text-muted small">@album.AssetCount assets</span>
|
||||
@@ -142,7 +142,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (album.Images.Count == 0) {
|
||||
@if (album!.Images.Count == 0) {
|
||||
<EmptyState Variant="info" Title="No assets in this album" />
|
||||
} else {
|
||||
<div class="@("album-assets-grid " + viewMode)">
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<span class="text-muted small">@pub public, @prot protected, @priv private</span>
|
||||
}
|
||||
<span class="mx-1">·</span>
|
||||
<span><i class="bi bi-image"></i> @person.TotalAssets assets</span>
|
||||
<span><i class="bi bi-image"></i> @person!.TotalAssets assets</span>
|
||||
@if (person.MaintainerUserIds?.Count > 0)
|
||||
{
|
||||
<span class="mx-1">·</span>
|
||||
|
||||
@@ -248,6 +248,7 @@
|
||||
}
|
||||
|
||||
void NavigatePreview(int direction) {
|
||||
if (selectedAsset == null) return;
|
||||
var newIndex = selectedIndex + direction;
|
||||
if (newIndex < 0 || newIndex >= flatList.Count) return;
|
||||
var newAsset = flatList[newIndex];
|
||||
|
||||
Reference in New Issue
Block a user