Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Controllers/ParatextController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Microsoft.Extensions.Configuration;
using MongoDB.Driver;
using SIL.XForge.DataAccess;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Migrator.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Diagnostics;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/AudioTiming.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

public class AudioTiming
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/EditorTabPersistData.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/InviteeStatus.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

public class InviteeStatus
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/Like.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

public class Like
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/Note.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>Represents a project note.</summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/NoteSyncMetricInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/NoteThread.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using SIL.XForge.Models;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/OnboardingRequest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using SIL.XForge.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/ParatextResource.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Globalization;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/ParatextUserProfile.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/Question.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using SIL.XForge.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/ResourceConfig.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;

namespace SIL.XForge.Scripture.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/SFProjectCreateSettings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/SFProjectUserConfig.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using SIL.XForge.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/ServalBuildDto.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

public class ServalBuildDto : ServalResourceDto
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/ServalResourceDto.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/SyncMetricInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/SyncMetrics.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using SIL.XForge.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TextAnchor.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TextAudio.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using SIL.Scripture;
using SIL.XForge.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TextData.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using Newtonsoft.Json;
using SIL.Scripture;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TransceleratorQuestion.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Scripture.Models;

public class TransceleratorQuestion
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TranslateMetrics.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using SIL.XForge.Models;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/TranslateSource.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using SIL.XForge.Models;

namespace SIL.XForge.Scripture.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Models/VerseRefData.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using SIL.Scripture;

namespace SIL.XForge.Scripture.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Pages/Shared/_Footer.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@inject IOptions<RequestLocalizationOptions> LocOptions

@{
#nullable disable warnings
var requestCulture = Context.Features.Get<IRequestCultureFeature>();
InterfaceLanguage? locale = LocOptions.Value.SupportedUICultures?.Where(c =>
SharedResource.Cultures[c.IetfLanguageTag].Tags.Contains(requestCulture.RequestCulture.UICulture.Name)
Comment on lines +11 to 14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Inconsistent null handling between _Footer.cshtml and _SelectLanguagePartial.cshtml

Both _Footer.cshtml:12 and _SelectLanguagePartial.cshtml:11 obtain requestCulture from Context.Features.Get<IRequestCultureFeature>(), which can return null. The PR properly adds a null check in _SelectLanguagePartial.cshtml:31 (@if (requestCulture != null)), but in _Footer.cshtml:11 it only adds #nullable disable warnings to suppress the compiler warning. If requestCulture is null, _Footer.cshtml:14 would throw a NullReferenceException when accessing requestCulture.RequestCulture.UICulture.Name. While IRequestCultureFeature should always be present when UseRequestLocalization middleware is configured (src/SIL.XForge.Scripture/Startup.cs:252), this is a pre-existing inconsistency that the PR's nullable migration makes more visible. The AGENTS.md rule 'Corner-cases happen. They should be handled in code' suggests the _Footer.cshtml should also get a proper null check rather than just warning suppression.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing potential NREs is for possible followup, and not intended to be part of this PR. It was done in _SelectLanguagePartial.cshtml where I did not seem to be able to just #nullable disable warnings.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
@* Include the query string so users return to the exact page (including errors/404) after changing language. *@
<input type="hidden" name="returnUrl" value="@(Context.Request.Path + Context.Request.QueryString)" />
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<select name="culture" class="mdl-textfield__input" onchange="this.form.submit();"
asp-for="@requestCulture.RequestCulture.UICulture.Name" asp-items="cultureItems">
</select>
@if (requestCulture != null)
{
<select name="culture" class="mdl-textfield__input" onchange="this.form.submit();"
asp-for="@requestCulture.RequestCulture.UICulture.Name" asp-items="cultureItems">
</select>
}
</div>
</form>
</div>
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.IO;
using System.Reflection;
using Microsoft.AspNetCore;
Expand Down
3 changes: 2 additions & 1 deletion src/SIL.XForge.Scripture/SIL.XForge.Scripture.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
Expand All @@ -10,7 +11,7 @@
<UserSecretsId>4d0606c3-0fc7-4d76-b43b-236485004e81</UserSecretsId>
<RealtimeServerRoot>..\RealtimeServer\</RealtimeServerRoot>
<AngularConfig>production</AngularConfig>
<Nullable>annotations</Nullable>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Suppress complier warning "Missing XML comment for publicly visible type or member" -->
<NoWarn>$(NoWarn);1591</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using Newtonsoft.Json;
using SIL.XForge.Scripture.Models;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/DeltaUsxExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Newtonsoft.Json.Linq;
using SIL.XForge.Realtime.RichText;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/DeltaUsxMapper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/DotNetCoreRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Microsoft.Win32;
using PtxUtils;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/HgWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.IO;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/IParatextService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/IScrTextCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Paratext.Data;
using Paratext.Data.ProjectFileAccess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/JwtTokenHelper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Diagnostics;
using System.IdentityModel.Tokens.Jwt;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/LambdaTraceListener.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Text;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/LazyScrTextCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.IO;
using System.Linq;
using System.Xml.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/MachineApiService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/MachineProjectService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Net;
using System.Net.Http;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/MutexAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Globalization;
using Hangfire.Common;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/NotesFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/ParatextDataHelper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/ParatextNotesMapper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/ParatextService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/ParatextSyncRunner.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Paratext.Data;
using PtxUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using PtxUtils;

namespace SIL.XForge.Scripture;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/PreTranslationService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using Microsoft.Extensions.DependencyInjection;
using SIL.XForge.Scripture.Services;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/SFProjectRights.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/SFProjectService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/SFScrTextCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/SyncService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Threading;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/TrainingDataService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Services/TransceleratorService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/SharedResource.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge.Scripture/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge/Configuration/AudioOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Configuration;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge/Configuration/DataAccessOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Configuration;

public class DataAccessOptions
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge/Configuration/ParatextOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
namespace SIL.XForge.Configuration;

public class ParatextOptions
Expand Down
1 change: 1 addition & 0 deletions src/SIL.XForge/Configuration/RealtimeOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable disable warnings
using System.Collections.Generic;
using SIL.XForge.Models;

Expand Down
Loading
Loading