summaryrefslogtreecommitdiff
path: root/python/depcache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/depcache.cc')
-rw-r--r--python/depcache.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index b7294644..014ad7ae 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -997,7 +997,8 @@ static const char *actiongroup__exit__doc =
"Same as release(), but for use as a context manager.";
static PyObject *PkgActionGroupExit(PyObject *Self,PyObject *Args) {
pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
- ag->release();
+ if (ag != NULL)
+ ag->release();
Py_RETURN_FALSE;
}