summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgenerator/nanopb_generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 62ee41bf..0748e630 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -730,10 +730,11 @@ class OneOf(Field):
return largest
def encoded_size(self, dependencies):
+ '''Returns the size of the largest oneof field.'''
largest = EncodedSize(0)
for f in self.fields:
size = EncodedSize(f.encoded_size(dependencies))
- if size is None:
+ if size.value is None:
return None
elif size.symbols:
return None # Cannot resolve maximum of symbols