Skip to content

Conversation

@jasells
Copy link

@jasells jasells commented Dec 31, 2020

This fixes #959 for running unit tests in Debug.

@jasells
Copy link
Author

jasells commented Jan 10, 2021

All tests run locally, not sure what the problem is

@valeriob
Copy link
Contributor

I encountered the same problem, is this fix ready ?

@dakelley95
Copy link

Encountered same issue as well. Would love this fix.

/// Get the number of bytes within the buffer that is past the Offset (ie, buffer-length minus offset).
/// </summary>
public int Size => m_innerBuffer.Length - Offset;
public int Size => m_innerBuffer == null ? 0 : m_innerBuffer.Length - Offset;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change. Code shouldn't be using an initialised version of this struct. The buffer should always be non-null. If it's null here, then there's a bug somewhere else. That is the bug that should probably be identified and fixed. At least that's my working assumption.

@drewnoakes
Copy link
Member

Going to close this out as the primary change that was made here was made elsewhere (and so disappeared from this diff). The only remaining change is the null defense, and I don't think we should be making that, as commented above.

@drewnoakes drewnoakes closed this Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple failing unit tests

4 participants