瀏覽代碼

use ensure_mapped context manager in dump

Christian Mönch 2 年之前
父節點
當前提交
8c17ad3274
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      dataladmetadatamodel/mappableobject.py

+ 2 - 1
dataladmetadatamodel/mappableobject.py

@@ -17,7 +17,8 @@ from dataladmetadatamodel.mapper.reference import Reference
 def ensure_mapped(mappable_object):
     needs_purge = False
     try:
-        needs_purge = mappable_object.ensure_mapped()
+        if mappable_object is not None:
+            needs_purge = mappable_object.ensure_mapped()
         yield mappable_object
     finally:
         if needs_purge: