Processing crashes when trying to open a file

Processing works fine in an empty sketch, but the moment I use ctrl-o or any other way to open a file, the gui doesn’t show any of the textfiles, and when you then press cancel processing crashes with the following message:

Exception in thread "Thread-7" java.lang.NullPointerException
	at java.io.File.<init>(File.java:277)
	at sun.awt.X11.GtkFileDialogPeer.filenameFilterCallback(GtkFileDialogPeer.java:105)
	at sun.awt.X11.GtkFileDialogPeer.run(Native Method)
	at sun.awt.X11.GtkFileDialogPeer.showNativeDialog(GtkFileDialogPeer.java:174)
	at sun.awt.X11.GtkFileDialogPeer.access$000(GtkFileDialogPeer.java:38)
	at sun.awt.X11.GtkFileDialogPeer$1.run(GtkFileDialogPeer.java:116)

I have already tried changing redownloading processing after deleting the processing folder, sketchbook folder and .processing folder.

This is caused by a problem with the file chooser in processing. The same thing happened on my system but the cause is unknown. Once processing crashes in this manner, the only way to make it quit is to run killall -9 java
A work-around for this problem is to change the file chooser. Go to your preferences.txt file for processing (on most linux systems this would be ~/.processing/processing.txt) and change the line
chooser.files.native=true
to
chooser.files.native=false