summaryrefslogtreecommitdiff
path: root/python/indexfile.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-24 20:49:39 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-24 20:49:39 +0200
commitdb27b9d050c466eabf6eb72899bfbe696af8852b (patch)
tree0a1e56c1fdddbe6c47530e033a282e8da54b1a3e /python/indexfile.cc
parentfda01b9ec100db7d2e5f7434edadd1fe84d4fdee (diff)
downloadpython-apt-db27b9d050c466eabf6eb72899bfbe696af8852b.tar.gz
python: Fix some more possible NULL issues.
Diffstat (limited to 'python/indexfile.cc')
-rw-r--r--python/indexfile.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/indexfile.cc b/python/indexfile.cc
index 74345ec9..a6f8904e 100644
--- a/python/indexfile.cc
+++ b/python/indexfile.cc
@@ -55,6 +55,7 @@ static PyObject *PackageIndexFileGetIsTrusted(PyObject *Self,void*) {
}
#undef File
+#define S(x) (x ? x : "")
static PyObject *PackageIndexFileRepr(PyObject *Self)
{
pkgIndexFile *File = GetCpp<pkgIndexFile*>(Self);
@@ -62,10 +63,11 @@ static PyObject *PackageIndexFileRepr(PyObject *Self)
"Label:'%s' Describe='%s' Exists='%i' "
"HasPackages='%i' Size='%lu' "
"IsTrusted='%i' ArchiveURI='%s'>",
- File->GetType()->Label, File->Describe().c_str(), File->Exists(),
+ S(File->GetType()->Label), File->Describe().c_str(), File->Exists(),
File->HasPackages(), File->Size(),
File->IsTrusted(), File->ArchiveURI("").c_str());
}
+#undef S
static PyGetSetDef PackageIndexFileGetSet[] = {
{"describe",PackageIndexFileGetDescribe},