Forums > Java

NullPointerException at com.cycling74.max.Atom.toOneString(Atom.java:910)

November 15, 2009 | 3:35 am

I’ve a textedit box hooked up to an mxj (based on the Max quickie template), with the following method:

public void text(Atom[] atoms) { Atom.toString(atoms); }

Nice and simple. And no errors normally, except when I put a comma in the text box, when the Max window showed:

newAtom: default (11)
java.lang.NullPointerException
	at com.cycling74.max.Atom.toOneString(Atom.java:910)
	at TestObj.text(TestObj.java:42)

For now, I’ll catch the NullPointerException and show a friendlier error message, I suppose. But I wish it would be handled silently — converted to , automatically, for example.

Any thoughts or suggestions on how to handle this would be appreciated. I’m using the latest version of Max5 with Snow Leopard’s Javac. I could imagine somehow escaping the comma before passing the message to the mxj object, but can’t imagine how.

Louis.


Viewing 1 post (of 1 total)