Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in Workspace.CollectDataLayoutNodes #2600

Closed
fm-117 opened this issue Dec 15, 2023 · 1 comment · Fixed by #2601
Closed

NullReferenceException in Workspace.CollectDataLayoutNodes #2600

fm-117 opened this issue Dec 15, 2023 · 1 comment · Fixed by #2601
Assignees
Labels
Bug Cobol From logging User Visible Visible by the end user. Useful to priorize issue

Comments

@fm-117
Copy link
Contributor

fm-117 commented Dec 15, 2023

Describe the bug
A NullReferenceException may be thrown by Workspace.CollectDataLayoutNodes method.

To Reproduce
No source code to reproduce.

Expected behavior
No exception.

Technical
See

Node dataDivision = compilationUnit.TemporaryProgramClassDocumentSnapshot.Root.MainProgram.GetChildren<DataDivision>().FirstOrDefault();

This line should be protected against null values.

How to test automatically
TODO

@fm-117 fm-117 added Bug Cobol User Visible Visible by the end user. Useful to priorize issue labels Dec 15, 2023
@fm-117
Copy link
Contributor Author

fm-117 commented Dec 15, 2023

Full stacktrace:

   at TypeCobol.LanguageServer.Workspace.CollectDataLayoutNodes(CompilationUnit compilationUnit)
   at TypeCobol.LanguageServer.Workspace.GetDataLayoutAsCSV(CompilationUnit compilationUnit, String separator)
   at TypeCobol.LanguageServer.TypeCobolCustomLanguageServerProtocol.TypeCobolCustomLanguageServer.OnDidReceiveGetDataLayout(GetDataLayoutParams parameter)
   at TypeCobol.LanguageServer.TypeCobolCustomLanguageServerProtocol.TypeCobolCustomLanguageServer.ReceivedGetDataLayoutRequest(RequestType requestType, Object parameters, LSPProfiling lspProfiling)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Cobol From logging User Visible Visible by the end user. Useful to priorize issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants