浏览代码

qubes: fix instantiating with no or empty qubes.xml

There is always dom0 (domid=0) added, but it has None as self.xml.
Wojtek Porczyk 8 年之前
父节点
当前提交
e4a0cfc8c8
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      qubes/__init__.py

+ 2 - 0
qubes/__init__.py

@@ -912,6 +912,8 @@ class PropertyHolder(qubes.events.Emitter):
         :param int load_stage: Stage of loading.
         :param int load_stage: Stage of loading.
         '''
         '''
 
 
+        if self.xml is None:
+            return
         all_names = set(
         all_names = set(
             prop.__name__ for prop in self.property_list(load_stage))
             prop.__name__ for prop in self.property_list(load_stage))
         for node in self.xml.xpath('./properties/property'):
         for node in self.xml.xpath('./properties/property'):