Add nullability to core project

This commit is contained in:
Nikolaj Geisle
2022-02-09 13:24:35 +01:00
parent 936dd38c55
commit b75eae01f3
259 changed files with 1219 additions and 1112 deletions

View File

@@ -270,11 +270,15 @@ namespace Umbraco.Cms.Core.Services.Implement
/// </summary>
/// <param name="id">Id of the <see cref="IDataType"/></param>
/// <returns><see cref="IDataType"/></returns>
public IDataType GetDataType(int id)
public IDataType GetDataType(int? id)
{
if (id is null)
{
return null;
}
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
var dataType = _dataTypeRepository.Get(id);
var dataType = _dataTypeRepository.Get(id.Value);
ConvertMissingEditorOfDataTypeToLabel(dataType);
return dataType;
}