From 2dd792de2e93cda6ec9084f2e9ea28beb43acf68 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Wed, 30 Sep 2015 20:43:35 -0400 Subject: [PATCH] Fix NPE from duplicating TranslatableComponent --- .../java/net/md_5/bungee/api/chat/TranslatableComponent.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java index c00b7fa94a..24e329496b 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java @@ -41,10 +41,12 @@ public TranslatableComponent(TranslatableComponent original) { super( original ); setTranslate( original.getTranslate() ); + List temp = new ArrayList(); for ( BaseComponent baseComponent : original.getWith() ) { - with.add( baseComponent.duplicate() ); + temp.add( baseComponent.duplicate() ); } + setWith( temp ); } /**