Fix NPEs in mlast commit.

This commit is contained in:
Lex Manos 2015-02-21 19:48:48 -08:00
parent 7269d22449
commit 9335e2907b

View file

@ -613,11 +613,17 @@ public class FMLModContainer implements ModContainer
return candidate.getContainedPackages(); return candidate.getContainedPackages();
} }
private boolean isTrue(Boolean value)
{
if (value == null) return false;
return value.booleanValue();
}
@Override @Override
public boolean shouldLoadInEnvironment() public boolean shouldLoadInEnvironment()
{ {
boolean clientSideOnly = (Boolean)this.descriptor.get("clientSideOnly"); boolean clientSideOnly = isTrue((Boolean)descriptor.get("clientSideOnly"));
boolean serverSideOnly = (Boolean)this.descriptor.get("serverSideOnly"); boolean serverSideOnly = isTrue((Boolean)descriptor.get("serverSideOnly"));
if (clientSideOnly && serverSideOnly) if (clientSideOnly && serverSideOnly)
throw new RuntimeException("Mod annotation claims to be both client and server side only!"); throw new RuntimeException("Mod annotation claims to be both client and server side only!");