Fix MAGN-4095 Getting crash while running Document after closing and reopening again.