Problem with ParseInt (GUI)

Hello,

when I use parseint in a textfield it is working fine while a number is in the field.

But when I delete all numbers in text field (text field is empty) I get the error:

FormatException: Input string was not in the correct format

I have following code:

private var listeningPort : int = 25000;

function OnGUI(){
listeningPort = parseInt(GUILayout.TextField(listeningPort.ToString()));
}

Read up about exception handling to test whether you can extract an int from the string returned by .TextField