get_null() was wrong

This commit is contained in:
2025-02-28 12:32:33 -08:00
parent 701077fa88
commit 457af2015b

View File

@ -191,9 +191,6 @@ class Deserializer:
func get_bool() -> bool: func get_bool() -> bool:
return (get_int8() == 1) return (get_int8() == 1)
func get_null() -> void:
read_position += 1
func read_dictionary() -> Dictionary: func read_dictionary() -> Dictionary:
var object = {} var object = {}
@ -220,9 +217,7 @@ class Deserializer:
0x08: object[key] = get_bool() 0x08: object[key] = get_bool()
0x04: object[key] = read_array() 0x04: object[key] = read_array()
0x03: object[key] = read_dictionary() 0x03: object[key] = read_dictionary()
0x0a: 0x0a: object[key] = null
object[key] = null
get_null()
_: _:
push_error("BSON deserialization error: Unsupported type " push_error("BSON deserialization error: Unsupported type "
+ str(type) + str(type)
@ -270,9 +265,7 @@ class Deserializer:
0x08: array.append(get_bool()) 0x08: array.append(get_bool())
0x04: array.append(read_array()) 0x04: array.append(read_array())
0x03: array.append(read_dictionary()) 0x03: array.append(read_dictionary())
0x0a: 0x0a: array.append(null)
array.append(null)
get_null()
_: push_error("BSON deserialization error: Unsupported type: " + str(type)) _: push_error("BSON deserialization error: Unsupported type: " + str(type))
if iter > expected_size: if iter > expected_size:
push_warning("BSON deserialization warning: Array is the wrong length." push_warning("BSON deserialization warning: Array is the wrong length."