it can happen that !d->mManager->isValid() if the server is not running yet but started right after the manager got created. So, the solution to fix the assert is to just don't ask for the agentTypes() and agentInstances() in that case since they are empty anyway.
svn path=/trunk/KDE/kdepimlibs/; revision=979288