Kaynağa Gözat

Fix: TMap.Copy() now only copies _root if there were entries in the map

Ronny Otto 8 yıl önce
ebeveyn
işleme
ba7901ff4a
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      map.mod/map.bmx

+ 4 - 1
map.mod/map.bmx

@@ -293,7 +293,10 @@ Type TMap
 	
 	
 	Method Copy:TMap()
 	Method Copy:TMap()
 		Local map:TMap=New TMap
 		Local map:TMap=New TMap
-		map._root=_root.Copy( nil )
+		'avoid copying an empty map (_root = nil there), else it borks "eachin"
+		if _root <> nil
+			map._root=_root.Copy( nil )
+		endif
 		Return map
 		Return map
 	End Method
 	End Method