Skip to content

Commit 53e0f0c

Browse files
committed
Added fix for #46
According to @photoniker in issue #46, some arrays can have a null sub type code.
1 parent a3a8e29 commit 53e0f0c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

javaobj/v2/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,9 @@ def _read_field_value(self, field_type):
625625
if field_type in (FieldType.OBJECT, FieldType.ARRAY):
626626
sub_type_code = self.__reader.read_byte()
627627
if field_type == FieldType.ARRAY:
628+
if sub_type_code == TerminalCode.TC_NULL:
629+
# Seems required, according to issue #46
630+
return None
628631
if sub_type_code == TerminalCode.TC_REFERENCE:
629632
return self._do_classdesc(sub_type_code)
630633
if sub_type_code != TerminalCode.TC_ARRAY:

0 commit comments

Comments
 (0)