Skip to content

Commit f1c32ea

Browse files
refactor(audience): enable nullable reference types on Slice 4 files
- Runtime/Unity/AudienceUnityHooks.cs: directive only (all references come from UnityEngine which is typed conservatively). - ImmutableAudience.cs: LaunchContextProvider field (added by the auto-context commit on top of the already-annotated file) → nullable; unityContext local in FireGameLaunch → nullable (receives provider result that may be null on exception). Compile-time annotations only; zero runtime behaviour change.
1 parent 4971444 commit f1c32ea

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static class ImmutableAudience
3232

3333
// AudienceUnityHooks sets this so game_launch can auto-include
3434
// Unity context without the core referencing UnityEngine.
35-
internal static Func<Dictionary<string, object>> LaunchContextProvider;
35+
internal static Func<Dictionary<string, object>>? LaunchContextProvider;
3636

3737
// Starts the SDK. Call once at launch.
3838
public static void Init(AudienceConfig config)
@@ -569,7 +569,7 @@ private static void FireGameLaunch(AudienceConfig config, ConsentLevel consentAt
569569
var provider = LaunchContextProvider;
570570
if (provider != null)
571571
{
572-
Dictionary<string, object> unityContext = null;
572+
Dictionary<string, object>? unityContext = null;
573573
try { unityContext = provider(); }
574574
catch (Exception ex)
575575
{

src/Packages/Audience/Runtime/Unity/AudienceUnityHooks.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
using System.Collections.Generic;
24
using UnityEngine;
35

0 commit comments

Comments
 (0)