Skip to content

Commit

Permalink
Fix for null ref exception on loading a world
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Jan 5, 2025
1 parent db9cfa9 commit 513ff6a
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AudioAdderProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/AudioMultiply.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AudioMultiplyProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AudioSubtractorProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/BandPassFilterNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BandPassFilterProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

private BandPassFilterController _controller = new();

Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/ButterworthFilterNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ButterworthFilterProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

private ButterworthFilterController _controller = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EMA_IIR_SmoothSignalProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => AudioInput.ChannelCount;
public int ChannelCount => AudioInput?.ChannelCount ?? 0;

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/PhaseModulatorNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PhaseModulatorProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount);
public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0);

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/RingModulatorNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RingModulatorProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount);
public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0);

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SineShapedRingModulatorProxy : ProtoFluxEngineProxy, IAudioSource

public bool IsActive => Active;

public int ChannelCount => MathX.Min(AudioInput.ChannelCount, AudioInput2.ChannelCount);
public int ChannelCount => MathX.Min(AudioInput?.ChannelCount ?? 0, AudioInput2?.ChannelCount ?? 0);

public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>
{
Expand Down

0 comments on commit 513ff6a

Please sign in to comment.