Dont crash on close writer without connection