Prevent panic when aptempting closing statement if statement is nill

That would prevent base SQL error to be reported.