Skip to content

Commit

Permalink
handle path being None
Browse files Browse the repository at this point in the history
  • Loading branch information
m0mosenpai committed Jun 9, 2021
1 parent f9ff34e commit cfc6f3f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/commands/v2/pysa_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,14 @@ def invalid_models_to_diagnostics(
) -> Dict[Path, List[lsp.Diagnostic]]:
result: Dict[Path, List[lsp.Diagnostic]] = {}
for model in invalid_models:
result.setdefault(Path(model.path), []).append(
self.invalid_model_to_diagnostic(model)
)
if model.path is None:
self.log_and_show_message_to_client(
"Path cannot be None", lsp.MessageType.WARNING
)
else:
result.setdefault(Path(model.path), []).append(
self.invalid_model_to_diagnostic(model)
)
return result

async def update_errors(self, document_path: Path) -> None:
Expand Down

0 comments on commit cfc6f3f

Please sign in to comment.