Skip to content

Commit 54c6d95

Browse files
arthansonjeremystretch
authored andcommitted
15654 check for no termination in TunnelTerminationSerializer
1 parent b7668fb commit 54c6d95

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

netbox/vpn/api/serializers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class Meta:
9898

9999
@extend_schema_field(serializers.JSONField(allow_null=True))
100100
def get_termination(self, obj):
101+
if not obj.termination:
102+
return None
103+
101104
serializer = get_serializer_for_model(obj.termination, prefix=NESTED_SERIALIZER_PREFIX)
102105
context = {'request': self.context['request']}
103106
return serializer(obj.termination, context=context).data

0 commit comments

Comments
 (0)