Skip to content

Commit

Permalink
Check for null.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Oct 6, 2013
1 parent 3b74cd1 commit 5edc8ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/aufdemrand/denizen/objects/dInventory.java
Expand Up @@ -727,21 +727,21 @@ public String getAttribute(Attribute attribute) {
attribute.hasContext(3) &&
aH.matchesInteger(attribute.getContext(3))) {

qty = attribute.getIntContext(2);
qty = attribute.getIntContext(3);
attribs = 3;
}

int found_items = 0;

if (strict) {
for (ItemStack item : getContents()) {
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName() &&
if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() &&
item.getItemMeta().getDisplayName().equalsIgnoreCase(search_string))
found_items++;
}
} else {
for (ItemStack item : getContents()) {
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName() &&
if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() &&
item.getItemMeta().getDisplayName().toLowerCase()
.contains(search_string.toLowerCase()))
found_items++;
Expand Down

0 comments on commit 5edc8ae

Please sign in to comment.