-
Notifications
You must be signed in to change notification settings - Fork 920
Description
Apache NetBeans version
Apache NetBeans 17
What happened
I'm getting a java.lang.NullPointerException when opening a .JSON file in NetBeans. Note the file opens correctly just this Silent Error is thrown.
The error is:
Cannot invoke "org.openide.filesystems.FileObject.getMIMEType()" because "this.internalFo" is null
I believe it is because there are no Code Templates for JSON and the Code Templates window is open. Although not tested, I believe the same error will be thrown if other Code Templates sections don't have any code templates defined.
How to reproduce
- Open the Code Templates window (Window>Code Templates)
- Create a JSON file with some dummy JSON data and give the file the extension: .json
- In Tools>Options>Editor>Code Templates>JSON make sure there are no templates
- Open the .json file in NetBeans.
- Silent Error (Unexpected Exception) is thrown
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux Mint 19.3 Cinnamon - Linux Kernel 5.4.0-144-generic
JDK
openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment (build 17.0.6+10-Ubuntu-0ubuntu118.04.1)
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
This error can be eliminated by adding a Code Template to the Code Templates (JSON) section.
Are you willing to submit a pull request?
No