Null check on socketIO object