DoResize(-1,-1) - I don't know why you'd ever want to attempt to resize to -1,-1.

Also removed the else clause as it hides the error until later, now size will be null at the appropriate time.