Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more warnings #331

Merged
merged 1 commit into from
Nov 14, 2023
Merged
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
4 changes: 2 additions & 2 deletions src/Altinn.App.Api/Altinn.App.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
Expand All @@ -13,7 +13,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Altinn/app-lib-dotnet</RepositoryUrl>
<IsPackable>true</IsPackable>
<ImplicitUsings>true</ImplicitUsings>
<ImplicitUsings>enable</ImplicitUsings>

<!-- SonarCloud requires a ProjectGuid to separate projects. -->
<ProjectGuid>{E8F29FE8-6B62-41F1-A08C-2A318DD08BB4}</ProjectGuid>
Expand Down
4 changes: 2 additions & 2 deletions src/Altinn.App.Api/Controllers/PagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class PagesController : ControllerBase
/// <param name="pageOrder">The page order service</param>
public PagesController(
IAppModel appModel,
IAppResources resources,
IPageOrder pageOrder,
IAppResources resources,
IPageOrder pageOrder,
ILogger<PagesController> logger)
{
_appModel = appModel;
Expand Down
2 changes: 1 addition & 1 deletion src/Altinn.App.Api/Helpers/StartupHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public static string GetApplicationId()
{
string appMetaDataString = File.ReadAllText("config/applicationmetadata.json");
JObject appMetadataJObject = JObject.Parse(appMetaDataString);
return appMetadataJObject.SelectToken("id").Value<string>();
return appMetadataJObject.SelectToken("id")?.Value<string>() ?? throw new Exception("config/applicationmetadata.json does not contain an \"id\" property");
tjololo marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Altinn.App.Core.Models.Validation;
using Altinn.Platform.Storage.Interface.Models;
using Microsoft.AspNetCore.Mvc;
using FluentAssertions;
using Moq;
using Xunit;

Expand Down Expand Up @@ -221,7 +222,7 @@ public async Task TestValidateData(ValidateDataTestScenario testScenario)
{
var result = await validateController.ValidateData(org, app, instanceOwnerId, testScenario.InstanceId,
testScenario.DataGuid);
Assert.IsType(testScenario.ExpectedResult, result);
result.Should().BeOfType(testScenario.ExpectedResult);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Altinn.App.Api.Tests.Mocks.Authentication
public class JwtCookiePostConfigureOptionsStub : IPostConfigureOptions<JwtCookieOptions>
{
/// <inheritdoc />
public void PostConfigure(string name, JwtCookieOptions options)
public void PostConfigure(string? name, JwtCookieOptions options)
{
if (string.IsNullOrEmpty(options.JwtCookieName))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<XacmlJsonResponse> GetDecisionForRequest(XacmlJsonRequestRoot
}
catch
{
return null;
return null!;
}
}

Expand Down
Loading