Prevent NPE from EnchantItemData null scroll or support item.

This commit is contained in:
MobiusDevelopment 2022-12-11 22:09:01 +00:00
parent 2340f45354
commit 66fc6fb921
29 changed files with 348 additions and 116 deletions

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -138,21 +138,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -138,21 +138,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -138,21 +138,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}

View File

@ -140,21 +140,29 @@ public class EnchantItemData implements IXmlReader
/**
* Gets the enchant scroll.
* @param scroll the scroll
* @param item the scroll item
* @return enchant template for scroll
*/
public EnchantScroll getEnchantScroll(Item scroll)
public EnchantScroll getEnchantScroll(Item item)
{
return _scrolls.get(scroll.getId());
if (item == null)
{
return null;
}
return _scrolls.get(item.getId());
}
/**
* Gets the support item.
* @param item the item
* @param item the support item
* @return enchant template for support item
*/
public EnchantSupportItem getSupportItem(Item item)
{
if (item == null)
{
return null;
}
return _supports.get(item.getId());
}