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

NPE after creation of new cmake project #703

Closed
ghentschke opened this issue Feb 9, 2024 · 0 comments · Fixed by #704
Closed

NPE after creation of new cmake project #703

ghentschke opened this issue Feb 9, 2024 · 0 comments · Fixed by #704
Assignees

Comments

@ghentschke
Copy link
Contributor

When a new cmake project has been created by the CDT new Project wizzard, a NPE gets thrown when opening the children of the project in the project explorer view.

To Reproduce
Steps to reproduce the behavior:

  1. Close your CDT IDE
  2. Remove your build binaries path from the PATH system environment variable (Windows).
  3. Open CDT IDE
  4. Go to File -> New... -> C/C++ Project -> Cmake Project
  5. Open children of new cmake project in the Project Explorer
  6. See error

Expected behavior
No NPE in log and no error message

Screenshots
Open children:
image
Get error message:
image

Version Information

  • Windows 10
  • Eclipse 2024-03
  • CDT master

Additional context

!ENTRY org.eclipse.core.jobs 4 2 2024-02-09 09:13:46.537
!MESSAGE An internal error occurred during: "Searching for Binaries (sdksfjkdj)".
!STACK 0
java.lang.NullPointerException: Cannot invoke "java.util.Collection.iterator()" because "c" is null
	at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:335)
	at org.eclipse.cdt.internal.core.model.CModelManager.getBinaryParser(CModelManager.java:621)
	at org.eclipse.cdt.internal.core.model.BinaryRunner$1.run(BinaryRunner.java:119)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.ui.navigator 4 2 2024-02-09 09:13:46.538
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.navigator".
!STACK 0
java.lang.NullPointerException: Cannot invoke "java.util.Collection.iterator()" because "c" is null
	at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:335)
	at org.eclipse.cdt.internal.core.model.CModelManager.getBinaryParser(CModelManager.java:621)
	at org.eclipse.cdt.internal.core.model.CProject.getLibraryReferences(CProject.java:197)
	at org.eclipse.cdt.internal.ui.cview.LibraryRefContainer.getChildren(LibraryRefContainer.java:63)
	at org.eclipse.cdt.internal.ui.cview.CViewContentProvider.getProjectChildren(CViewContentProvider.java:148)
	at org.eclipse.cdt.internal.ui.cview.CViewContentProvider.getChildren(CViewContentProvider.java:97)
	at org.eclipse.cdt.internal.ui.navigator.CNavigatorContentProvider.getChildren(CNavigatorContentProvider.java:231)
	at org.eclipse.cdt.internal.ui.navigator.CNavigatorContentProvider.getPipelinedChildren(CNavigatorContentProvider.java:256)
	at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.getPipelinedChildren(SafeDelegateTreeContentProvider.java:170)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.pipelineChildren(NavigatorContentServiceContentProvider.java:212)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider$1.run(NavigatorContentServiceContentProvider.java:168)
@ghentschke ghentschke self-assigned this Feb 9, 2024
ghentschke added a commit to ghentschke/cdt-changes that referenced this issue Feb 9, 2024
- fixes NPE when new cmake project has been created while there are no
C/C++ build binaries on the PATH environment variable. The NPE has been
thrown when the children of the project should be fetched (e.g. in
project explorer view)

fixes eclipse-cdt#703
ghentschke added a commit to ghentschke/cdt-changes that referenced this issue Feb 9, 2024
- fix NPE cause in ErrorBuildConfiguration

fixes eclipse-cdt#703
ghentschke added a commit to ghentschke/cdt-changes that referenced this issue Feb 9, 2024
ghentschke added a commit that referenced this issue Feb 11, 2024
[703] fix NPE when no build binaries on system PATH

- fixes NPE when new cmake project has been created while there are no
C/C++ build binaries on the PATH environment variable. The NPE has been
thrown when the children of the project should be fetched (e.g. in
project explorer view)
- fix NPE cause in ErrorBuildConfiguration
- fix unit test

fixes #703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant