Don't crash when dropping a non-existant graph.
cppcheck fixes.