fix unexpected null parameter to disconnect, closes, #2663