Repository navigation
Fix Python graph builder crash: NoneType split during relationship resolution - #1335
Merged
Shashankss1205 merged 2 commits intoJul 4, 2026
Conversation
…#1334) Three crash sites fixed: - tools/languages/python.py: _get_node_text() returns '' instead of None - tools/indexing/resolution/inheritance.py: guard .split() calls in resolve_inheritance_link() when base_class_str is None - tools/indexing/resolution/inheritance.py: guard .split() in build_embeds_links() when base list entry is None Fixes CodeGraphContext#1334
|
@alanhuu1990 is attempting to deploy a commit to the shashankss1205's projects Team on Vercel. A member of the Team first needs to authorize it. |
…ce.py, graph_builder.py)
Additional None-guard fixes discovered during full-index testing:
- inheritance.py:95 — guard imp['name'].split('.') via (imp.get('name') or '')
+ filter out imports with no name
- inheritance.py:326 — guard imported.split('.') when imported is None
- calls.py:1754,2145 — same guard as inheritance.py:95
- graph_builder.py:531 — same guard
Fixes CodeGraphContext#1334
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes issue #1334 where the Python graph builder crashes with
'NoneType' object has no attribute 'split'during post-parse relationship resolution.Root Cause
_get_node_text()intools/languages/python.pyreturnsNoneinstead of""when a node's text is unavailable. ThisNonepropagates into thebaseslist in_find_classes(), then into inheritance resolution code.Changes
tools/languages/python.py—_get_node_text()now returns""instead ofNonewhen node text is unavailabletools/indexing/resolution/inheritance.py— Added guard inresolve_inheritance_link()forNonebase_class_str before.split()tools/indexing/resolution/inheritance.py— Added guard inbuild_embeds_links()forNoneentries in bases listTesting
codegraphcontext statsshows correct file/function/class countsFixes #1334