Skip to content

Commit

Permalink
chore: Handle the case where samples_dir has no value
Browse files Browse the repository at this point in the history
A crash from the user was reported.
  • Loading branch information
MatejKastak committed Mar 30, 2024
1 parent 299a8ee commit 57e62e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yls/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def display_py_object(value: Any) -> str:
async def get_samples_dir(ls: Any) -> Path | None:
samples_dir_config = await utils.get_config_from_editor(ls, "yls.yari.samplesDirectory")
log.debug(f"[DEBUGGER] Got {samples_dir_config=}")
if not samples_dir_config:
return None

samples_dir_path = Path(samples_dir_config).expanduser().resolve()
log.debug(f"[DEBUGGER] Resolved {samples_dir_config=}")

Expand Down

0 comments on commit 57e62e4

Please sign in to comment.