diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index d41885cba65e9e73f1f3ec2245991d7998642fd3..98d278a6bde3026d959c53565ec5aa88ace0071f 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -346,8 +346,14 @@ class DnfDaemonBase(dbus.service.Object, DownloadCallback):
         value = json.dumps(None)
         repo = self.base.repos.get(repo_id, None)  # get the repo object
         if repo:
-            # VectorString is not JSON serializable let's convert to list
-            repo_conf = dict([(c, getattr(repo, c) if 'VectorString' not in str(type(getattr(repo, c))) else list(getattr(repo, c))) for c in optionKeys])
+            repo_conf = {}
+            for c in optionKeys:
+                if hasattr(repo,c):
+                    value = getattr(repo, c)
+                    # VectorString is not JSON serializable let's convert to list
+                    if 'VectorString' in str(type(value)):
+                        value = list(value)
+                    repo_conf[c] = value
 
             enab = repo.enabled
             if not enab: