Check for a null window in the callbacks