you already did a try.. catch.  You should not check for input!= null, that is what the catch does.

Eiother use try....catch consistently, or use if...then...else... but don't use both.