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

[CoreText] Add NotNullWhen to help MAUI with null errors. #20050

Merged
merged 3 commits into from
Feb 8, 2024
Merged
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
3 changes: 2 additions & 1 deletion src/CoreText/CTFontManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;

using ObjCRuntime;
using CoreFoundation;
Expand Down Expand Up @@ -438,7 +439,7 @@ public static CTFontDescriptor [] GetFonts (NSUrl url)
[return: MarshalAs (UnmanagedType.I1)]
static extern bool CTFontManagerRegisterGraphicsFont (IntPtr cgfont, out IntPtr error);

public static bool RegisterGraphicsFont (CGFont font, out NSError? error)
public static bool RegisterGraphicsFont (CGFont font, [NotNullWhen (true)] out NSError? error)
{
if (font is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (font));
Expand Down
Loading