microsoft / microsoft/azure-tools-for-java
[IntelliJ] Uncaught Exception java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.vfs.VirtualFile.getPath()" because the return value of "com.intellij.openapi.vfs.VirtualFile.getParent()" is null
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 262
- Forks
- 185
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 1
Description
IntelliJ build version: 2024.2.2 IU-242.22855.74
OS: Windows 10
JDK: JetBrains s.r.o. 21.0.3
Plugin version: 3.92.0-2024.2
Additional Info: None
Parent component:
com.intellij.openapi.wm.impl.IdeRootPane[,8,0,1674x1009,layout=com.intellij.openapi.wm.impl.IdeRootPane$MyRootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=]
Error message:
IdeaLoggingEvent[message=null, throwable=java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.vfs.VirtualFile.getPath()" because the return value of "com.intellij.openapi.vfs.VirtualFile.getParent()" is null
at com.microsoft.azure.toolkit.intellij.container.model.DockerImage.<init>(DockerImage.java:57)
at com.microsoft.azure.toolkit.intellij.containerregistry.runner.ContainerRegistryDockerfileActionsProvider.getActions(ContainerRegistryDockerfileActionsProvider.java:17)
at com.microsoft.azure.toolkit.intellij.containerregistry.runner.DockerRunLineMarkerProvider.lambda$getDockerfileActions$2(DockerRunLineMarkerProvider.java:105)
at com.microsoft.azure.toolkit.intellij.containerregistry.runner.DockerRunLineMarkerProvider.getDockerfileActions(DockerRunLineMarkerProvider.java:108)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in DockerImage.java at line 57, then follow how ContainerRegistryDockerfileActionsProvider.getActions and DockerRunLineMarkerProvider.getDockerfileActions reach it. Reproduce the Dockerfile action in IntelliJ using the reported environment and verify that a file without a parent no longer causes an uncaught NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100