File 0001-zypp-Return-error-if-invalid-package-IDs-are-detecte.patch of Package PackageKit.9848

From 90224f3cd99d8f2f4371f7ae9fb8f602e740838d Mon Sep 17 00:00:00 2001
From: Michael Andres <ma@suse.de>
Date: Fri, 22 Jul 2016 09:17:51 +0200
Subject: [PATCH] zypp: Return error if invalid package IDs are detected

---
 backends/zypp/pk-backend-zypp.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 49282fb..96a8180 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -2403,6 +2403,12 @@ backend_get_update_detail_thread (PkBackendJob *job, GVariant *params, gpointer
 	for (uint i = 0; package_ids[i]; i++) {
 		sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);
 		MIL << package_ids[i] << " " << solvable << endl;
+		if (!solvable) {
+			// Previously stored package_id no longer matches any solvable.
+			zypp_backend_finished_error (job, PK_ERROR_ENUM_PACKAGE_NOT_FOUND,
+						     "couldn't find package");
+			return;
+		}
 
 		Capabilities obs = solvable.obsoletes ();
 
-- 
2.1.4