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 sun.awt.X11.GtkFileDialogPeer.filenameFilterCallback(
	at Method)
	at sun.awt.X11.GtkFileDialogPeer.showNativeDialog(
	at sun.awt.X11.GtkFileDialogPeer.access$000(
	at sun.awt.X11.GtkFileDialogPeer$

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