mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-07 13:53:38 +00:00
Python: return None for missing strings. (#4733)
[BREAKING CHANGE] Python: return None for missing strings.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3a2c535592
commit
b10123ff63
@@ -49,7 +49,7 @@ class Monster(object):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return bytes()
|
||||
return None
|
||||
|
||||
# Monster
|
||||
def Inventory(self, j):
|
||||
|
||||
@@ -23,7 +23,7 @@ class Stat(object):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return bytes()
|
||||
return None
|
||||
|
||||
# Stat
|
||||
def Val(self):
|
||||
|
||||
Reference in New Issue
Block a user