Skip to content

Commit

Permalink
Handle (de)serialize None values in Panel View
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Dec 18, 2024
1 parent d9197aa commit 3b580de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lumen/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ def from_spec(

@classmethod
def _resolve_object(cls, spec, objects=None, unresolved=None, depth=0):
if not isinstance(spec, dict) or 'type' not in spec:
if spec is None:
return None
elif not isinstance(spec, dict) or 'type' not in spec:
return spec
elif spec['type'] in ('rx', 'param'):
try:
Expand Down Expand Up @@ -666,7 +668,9 @@ def _resolve_object(cls, spec, objects=None, unresolved=None, depth=0):

def _serialize_object(self, obj, objects=None, refs=None, depth=0):
obj_type = type(obj)
if objects is None:
if obj is None:
return None
elif objects is None:
objects = {'pipeline': self.pipeline, obj.name: obj}
else:
objects[obj.name] = obj
Expand Down

0 comments on commit 3b580de

Please sign in to comment.