You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError in _score_nodes when source_file is None #323
graphify query crashes with an AttributeError when a node in the graph has source_file explicitly set to None.
Traceback
Traceback (most recent call last):
File ".pyenv/versions/3.11.6/bin/graphify", line 8, in <module>
sys.exit(main())
File ".pyenv/versions/3.11.6/lib/python3.11/site-packages/graphify/__main__.py", line 510, in main
scored = _score_nodes(G, terms)
File ".pyenv/versions/3.11.6/lib/python3.11/site-packages/graphify/serve.py", line 38, in _score_nodes
source = data.get("source_file", "").lower()
AttributeError: 'NoneType' object has no attribute 'lower'
Root cause
In serve.py line 37-38, data.get("source_file", "") returns None when the key exists but its value is None. The .get() default only applies when the key is missing, not when it's present with a None value.
Three locations in the MCP server were calling .lower() on values that could be None — source_file, label in _score_nodes, and label in _find_node and _tool_get_node. All three now guard with or "" before the string operation.
Activity
safishamsi commentedon Apr 14, 2026
Fixed in v0.4.13.
Three locations in the MCP server were calling
.lower()on values that could beNone—source_file,labelin_score_nodes, andlabelin_find_nodeand_tool_get_node. All three now guard withor ""before the string operation.