File tree 2 files changed +10
-7
lines changed
colyseus/serialization/schema/types
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ function array_schema:delete_by_index(index)
88
88
89
89
self .items [dynamic_index ] = nil
90
90
end
91
-
91
+
92
92
self .indexes [index ] = nil
93
93
end
94
94
Original file line number Diff line number Diff line change 65
65
function map_schema :delete_by_index (index )
66
66
local dynamic_index = self .indexes [index ]
67
67
68
- -- delete key
69
- for i , k in pairs (self .dynamic_indexes ) do
70
- if k == dynamic_index then
71
- table.remove (self .dynamic_indexes , i )
72
- break
68
+ if dynamic_index ~= nil then
69
+ -- delete key
70
+ for i , k in pairs (self .dynamic_indexes ) do
71
+ if k == dynamic_index then
72
+ table.remove (self .dynamic_indexes , i )
73
+ break
74
+ end
73
75
end
76
+
77
+ self .items [dynamic_index ] = nil
74
78
end
75
79
76
- self .items [dynamic_index ] = nil
77
80
self .indexes [index ] = nil
78
81
end
79
82
You can’t perform that action at this time.
0 commit comments