mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-30 00:15:57 -04:00
Added null checks to SWGMap
This commit is contained in:
@@ -194,21 +194,14 @@ public class SWGMap<K, V> implements Map<K, V>, Serializable {
|
||||
K key = entry.getKey();
|
||||
V value = entry.getValue();
|
||||
|
||||
if (valid(key) && valid(value))
|
||||
{
|
||||
if (map.containsKey(key))
|
||||
{
|
||||
if (map.put(key, value) != null)
|
||||
{
|
||||
buffer.add(item(2, key, Baseline.toBytes(value), true, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(map.put(key, value) == null)
|
||||
{
|
||||
buffer.add(item(0, key, Baseline.toBytes(value), true, true));
|
||||
}
|
||||
if (key != null && valid(key) && value != null && valid(value)) {
|
||||
if (map.containsKey(key)) {
|
||||
map.put(key, value);
|
||||
buffer.add(item(2, key, Baseline.toBytes(value), true, true));
|
||||
} else {
|
||||
map.put(key, value);
|
||||
buffer.add(item(0, key, Baseline.toBytes(value), true, true));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user