Fix crahs by checking archive

http://reviewboard.kde.org/r/6184

svn path=/trunk/KDE/kdelibs/; revision=1208684
This commit is contained in:
Nicolas Lécureuil 2010-12-22 20:59:33 +00:00
parent ec872fa08d
commit c29c17c400

View File

@ -629,7 +629,7 @@ PackageMetadata PackageStructure::metadata()
kWarning() << "Could not open package file, unsupported archive format:" << d->path << mimetype->name(); kWarning() << "Could not open package file, unsupported archive format:" << d->path << mimetype->name();
} }
if (archive->open(QIODevice::ReadOnly)) { if (archive && archive->open(QIODevice::ReadOnly)) {
const KArchiveDirectory *source = archive->directory(); const KArchiveDirectory *source = archive->directory();
KTempDir tempdir; KTempDir tempdir;
source->copyTo(tempdir.name()); source->copyTo(tempdir.name());