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

Fix for null ref exception on loading a world #76

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
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
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
Loading