Skip to content

Commit

Permalink
fix: avoid NRE occur when PublishedValue<nullable> observed (#526)
Browse files Browse the repository at this point in the history
Closes #525
  • Loading branch information
ReinaS-64892 authored Feb 6, 2025
1 parent 5843f4d commit e3c8179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog
# Changelog

All notable changes to this project will be documented in this file.

Expand All @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Fixed
- Avoid NRE that occurs when a null is observed in a PublishedValue (#526)

### Changed

Expand Down
4 changes: 2 additions & 2 deletions Editor/PreviewSystem/ComputeContext/SingleObjectQueries.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region
#region

#if NDMF_VRCSDK3_AVATARS
using VRC.SDK3.Avatars.Components;
Expand Down Expand Up @@ -90,7 +90,7 @@ public static R Observe<T, R>(
)
where R : IEquatable<R>
{
return ctx.Observe(val, extract, (a, b) => a.Equals(b), callerPath: callerPath, callerLine: callerLine);
return ctx.Observe(val, extract, (a, b) => a is null ? b is null : a.Equals(b), callerPath: callerPath, callerLine: callerLine);
}

/// <summary>
Expand Down

0 comments on commit e3c8179

Please sign in to comment.