Skip to content

Comments

avoid trying to copy this byte if Data is empty#40

Merged
viktorstrate merged 1 commit intoviktorstrate:mainfrom
sloatescoan:guard-computeMimeType
Feb 16, 2026
Merged

avoid trying to copy this byte if Data is empty#40
viktorstrate merged 1 commit intoviktorstrate:mainfrom
sloatescoan:guard-computeMimeType

Conversation

@scoates
Copy link
Contributor

@scoates scoates commented Feb 16, 2026

The self.copyBytes(to: &b, count: 1) here sometimes triggers/traps EXC_BREAKPOINT.

For me, this was triggering when switching Mactrix to the #Mactrix room, on my local build.

This seems to be because there's a failed assertion (or similar) that protects in debug builds. I had a hard time tracking down the actual copyBytes(to:count:) source.

The guard here avoids even trying to copy the bytes if Self (Data) is empty.

@viktorstrate viktorstrate merged commit 2f1a9f8 into viktorstrate:main Feb 16, 2026
2 checks passed
@scoates scoates deleted the guard-computeMimeType branch February 16, 2026 22:07
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.

2 participants