Fix for java.lang.NumberFormatException: For input string: ""

I am not sure that it's a best solution. But looks like it works for me.