From bd6df1d8419eb3403e64191681b32fbd1f3accac Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 21 Oct 2005 19:59:51 +0000 Subject: * fix a crasher in the install interface --- python/progress.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'python/progress.cc') diff --git a/python/progress.cc b/python/progress.cc index 5267134f..12f9c7a8 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -244,9 +244,13 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) #endif if (child_id == 0) { PyObject *v = PyObject_GetAttrString(callbackInst, "writefd"); - int fd = PyObject_AsFileDescriptor(v); - cout << "got fd: " << fd << endl; - res = pm->DoInstall(fd); + if(v) { + int fd = PyObject_AsFileDescriptor(v); + cout << "got fd: " << fd << endl; + res = pm->DoInstall(fd); + } else { + res = pm->DoInstall(); + } _exit(res); } -- cgit v1.2.3