Fix an error caused by get_peername returning a nil value