checkOpen method Null safety

void checkOpen()

Checks if connection is open