issue: 423266 checking if con is not null before closing

Change-Id: I07ad5c6e11f8dd3c46b5665646f6f18d989d12b3