Split FreeColAction:275 so we can see where the NPE in BR#3249.

This commit is contained in:
Mike Pope 2022-05-03 16:57:10 +09:30 committed by Calebrw
parent f5b0996d7d
commit 69ec58b69e
1 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,7 @@ import net.sf.freecol.client.FreeColClient;
import net.sf.freecol.client.control.ConnectController;
import net.sf.freecol.client.control.InGameController;
import net.sf.freecol.client.gui.GUI;
import net.sf.freecol.client.gui.ImageLibrary;
import net.sf.freecol.client.gui.dialog.ClientOptionsDialog;
import net.sf.freecol.common.i18n.Messages;
import net.sf.freecol.common.io.FreeColXMLReader;
@ -272,7 +273,8 @@ public abstract class FreeColAction extends AbstractAction
}
private void updateImageIcon(String key) {
List<BufferedImage> images = getGUI().getFixedImageLibrary().getButtonImages(key);
final ImageLibrary lib = getGUI().getFixedImageLibrary();
List<BufferedImage> images = lib.getButtonImages(key);
orderButtonImageCount = images.size();
if (hasOrderButtons()) {
putValue(BUTTON_IMAGE, new ImageIcon(images.remove(0)));