Skip to content

Commit 079bdd7

Browse files
committed
fix: guard or narrow row before indexing it.
1 parent 82043a8 commit 079bdd7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

services/workspace_resolver.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,10 @@ def _infer_workspace_name_from_context(workspace_path: str, workspace_id: str) -
8989
except sqlite3.Error:
9090
continue
9191
for row in rows:
92+
if not row or row[0] is None:
93+
continue
9294
try:
93-
# sqlite3.Row supports string-key access at runtime when
94-
# row_factory = sqlite3.Row is set on the connection (see
95-
# _open_global_db); mypy's stub types Row as tuple[Any, ...]
96-
# which only accepts SupportsIndex, hence the ignore.
97-
ctx = json.loads(row["value"]) # type: ignore[call-overload]
95+
ctx = json.loads(row[0])
9896
except Exception:
9997
continue
10098
layouts = ctx.get("projectLayouts")

0 commit comments

Comments
 (0)