Fix NPE from duplicating TranslatableComponent

This commit is contained in:
Jedediah Smith 2015-09-30 20:43:35 -04:00 committed by Thinkofdeath
parent fa3678bcdd
commit 40c0618a3a

View File

@ -41,9 +41,15 @@ public class TranslatableComponent extends BaseComponent
{ {
super( original ); super( original );
setTranslate( original.getTranslate() ); setTranslate( original.getTranslate() );
for ( BaseComponent baseComponent : original.getWith() )
if ( original.getWith() != null )
{ {
with.add( baseComponent.duplicate() ); List<BaseComponent> temp = new ArrayList<BaseComponent>();
for ( BaseComponent baseComponent : original.getWith() )
{
temp.add( baseComponent.duplicate() );
}
setWith( temp );
} }
} }