Fix #280, crash on viewing the name of research notes from 1.6.4

This commit is contained in:
mezz committed 2014-10-10 00:25:20 -07:00
1 parent 4fcb9cb221
commit 5e9cc9e2b1
1 file changed
+6 -1
@@ -235,7 +235,12 @@ public class ItemResearchNote extends ItemForestry {
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
ResearchNote note = new ResearchNote(itemstack.getTagCompound());
return StringUtil.localizeAndFormatRaw(getUnlocalizedName(itemstack) + ".name", note.researcher.getName());
String researcherName;
if (note.researcher == null)
researcherName = "Sengir";
else
researcherName = note.researcher.getName();
return StringUtil.localizeAndFormatRaw(getUnlocalizedName(itemstack) + ".name", researcherName);
}
@SuppressWarnings({"unchecked", "rawtypes"})