Skip to content

Guard against empty projectile metadata lists - #330

Open
Travja wants to merge 1 commit into
devfrom
split/05-projectile-metadata-nullsafety
Open

Guard against empty projectile metadata lists#330
Travja wants to merge 1 commit into
devfrom
split/05-projectile-metadata-nullsafety

Conversation

@Travja

@Travja Travja commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Split out of #320 (piece 5/12, independent).

hasMetadata()/getMetadata() are not atomic, so a projectile's metadata can be removed between the two calls (e.g. by another plugin or a concurrent listener). Checks for an empty list before indexing into it instead of assuming a match is still present.

Backward compatibility

None applicable — purely defensive; behavior on the happy path (metadata present) is unchanged.

hasMetadata()/getMetadata() are not atomic, so a projectile's
metadata can be removed between the two calls (e.g. by another
plugin or a concurrent listener). Check for an empty list before
indexing into it instead of assuming a match is still present.
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