CSN1: fix serialization with unset value
This commit is contained in:
parent
f68c8485ec
commit
315bd60b98
|
@ -929,15 +929,16 @@ class CSN1List(CSN1Obj):
|
||||||
|
|
||||||
def _to_pack_obj(self):
|
def _to_pack_obj(self):
|
||||||
ret = []
|
ret = []
|
||||||
for i, val in enumerate(self._val):
|
if self._val is not None:
|
||||||
Obj = self._list[i]
|
for i, val in enumerate(self._val):
|
||||||
# transfer offset and value to Obj
|
Obj = self._list[i]
|
||||||
obj_off, obj_val = Obj._off, Obj._val
|
# transfer offset and value to Obj
|
||||||
Obj._off, Obj._val = self._off, val
|
obj_off, obj_val = Obj._off, Obj._val
|
||||||
ret.extend( Obj._to_pack_csn() )
|
Obj._off, Obj._val = self._off, val
|
||||||
# restore offset and value
|
ret.extend( Obj._to_pack_csn() )
|
||||||
self._off = Obj._off
|
# restore offset and value
|
||||||
Obj._off, Obj._val = obj_off, obj_val
|
self._off = Obj._off
|
||||||
|
Obj._off, Obj._val = obj_off, obj_val
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def clone(self):
|
def clone(self):
|
||||||
|
|
Loading…
Reference in New Issue