Skip to content

Commit ba6f183

Browse files
committed
try catching around hai addresses
1 parent 893da89 commit ba6f183

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

Basis/Packages/com.basis.eventdriver/BasisEventDriver.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,14 @@ public void LateUpdate()
326326
#endif
327327
ProfileEnd(PROF_REMOTE_AUDIO_APPLY);
328328

329-
HVRBasisBuiltInAddresses.Simulate();
329+
try
330+
{
331+
HVRBasisBuiltInAddresses.Simulate();
332+
}
333+
catch (Exception ex)
334+
{
335+
Debug.LogError($"HVRBasisBuiltInAddresses.Simulate failed: {ex}");
336+
}
330337

331338
// ── BlendShape simulate ──
332339
ProfileBegin(PROF_BLENDSHAPE_SIMULATE);

Basis/Packages/dev.hai-vr.basis.comms/Scripts/Systems/Runtime/Data/HVRBasisBuiltInAddresses.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ public HVRBasisBuiltInAddresses(HVRAvatarComms comms, bool isWearer)
7272

7373
public void Destroy()
7474
{
75-
if (_comms == null) return;
76-
if (_contextNullable == null) return;
75+
if (ReferenceEquals(_comms, null)) return;
76+
if (!Required.TryGetValue(_comms, out var list)) return;
7777

78-
Required[_comms].Remove(this);
79-
if (Required[_comms].Count == 0)
78+
list.Remove(this);
79+
if (list.Count == 0)
8080
{
8181
Required.Remove(_comms);
8282
Flags.Remove(_comms);
@@ -111,7 +111,9 @@ private void ApplyForAllInComms(HVRAvatarComms comms)
111111

112112
private void ProcessViseme(HVRAvatarComms comms)
113113
{
114+
if (comms == null) return;
114115
var variableStore = comms.VariableStore;
116+
if (variableStore == null) return;
115117
if (_firstTick)
116118
{
117119
variableStore.SubmitOrDefineDefaultValue(_addressIds[0], 1f); // sil has a default value of 1

0 commit comments

Comments
 (0)