Skip to content

fix: guard against empty query in SPARQL generator (#870)#934

Merged
cybermaggedon merged 1 commit into
release/v2.4from
fix/sparql-empty-query
May 18, 2026
Merged

fix: guard against empty query in SPARQL generator (#870)#934
cybermaggedon merged 1 commit into
release/v2.4from
fix/sparql-empty-query

Conversation

@cybermaggedon

Copy link
Copy Markdown
Contributor

Fixes #870

The startswith check on line 205 already guarantees query.split() is
non-empty (a string starting with "SELECT" etc. can't be whitespace-only). But as
the issue notes, it's a latent crash point if that guard changes. The defensive fix is trivial.

Split the query once and check the parts list before indexing,
preventing an IndexError if the LLM returns an empty or
whitespace-only string.
@github-actions

Copy link
Copy Markdown

Contributor License Agreement ✅

All contributors have signed the CLA. Thank you!

@cybermaggedon cybermaggedon merged commit 76e3358 into release/v2.4 May 18, 2026
3 checks passed
@cybermaggedon cybermaggedon deleted the fix/sparql-empty-query branch May 18, 2026 13:19
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.

1 participant