this is odd  why do you need the why not just  env  exceptionoccurred or just  ifs null is there a case where env  exceptionoccurred and ifs null if that is the case  you will need to clear the exception before you proceed 