Source:
<code>public void cleanUp() { MageFrame.removeGame(gameId); saveDividerLocations(); this.gameChatPanel.disconnect(); this.userChatPanel.disconnect(); this.removeListener(); this.handContainer.cleanUp(); this.stackObjects.cleanUp(); for (Map.Entry<UUID, PlayAreaPanel> playAreaPanelEntry : players.entrySet()) { playAreaPanelEntry.getValue().CleanUp(); } this.players.clear(); this.playersWhoLeft.clear(); if (jLayeredPane!= null) { jLayeredPane.remove(abilityPicker); } this.abilityPicker.cleanUp(); <START> if (jLayeredPane != null) { <END> jLayeredPane.remove(DialogManager.getManager(gameId)); } DialogManager.removeGame(gameId); if (pickNumber != null) { pickNumber.removeDialog(); } for (CardInfoWindowDialog exileDialog : exiles.values()) { exileDialog.cleanUp(); exileDialog.removeDialog(); } for (CardInfoWindowDialog graveyardDialog : graveyardWindows.values()) { graveyardDialog.cleanUp(); graveyardDialog.removeDialog(); } for (CardInfoWindowDialog revealDialog : revealed.values()) { revealDialog.cleanUp(); revealDialog.removeDialog(); } for (CardInfoWindowDialog lookedAtDialog : lookedAt.values()) { lookedAtDialog.cleanUp(); lookedAtDialog.removeDialog(); } for (ShowCardsDialog pickTargetDialog : pickTarget) { pickTargetDialog.cleanUp(); pickTargetDialog.removeDialog(); } Plugins.instance.getActionCallback().hideOpenComponents(); try { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); } catch (InterruptedException ex) { logger.fatal("popupContainer error:", ex); } jPanel2.remove(bigCard); this.bigCard = null; }</code><technical_language>minor: this jLayeredPane.remove(DialogManager.getManager(gameId)); moved other conditional checking jLayeredPane!= null line 308</technical_language>

Target:
public void cleanUp() { MageFrame.removeGame(gameId); saveDividerLocations(); this.gameChatPanel.disconnect(); this.userChatPanel.disconnect(); this.removeListener(); this.handContainer.cleanUp(); this.stackObjects.cleanUp(); for (Map.Entry<UUID, PlayAreaPanel> playAreaPanelEntry : players.entrySet()) { playAreaPanelEntry.getValue().CleanUp(); } this.players.clear(); this.playersWhoLeft.clear(); if (jLayeredPane!= null) { jLayeredPane.remove(abilityPicker); jLayeredPane.remove(DialogManager.getManager(gameId)); } this.abilityPicker.cleanUp(); DialogManager.removeGame(gameId); if (pickNumber != null) { pickNumber.removeDialog(); } for (CardInfoWindowDialog exileDialog : exiles.values()) { exileDialog.cleanUp(); exileDialog.removeDialog(); } for (CardInfoWindowDialog graveyardDialog : graveyardWindows.values()) { graveyardDialog.cleanUp(); graveyardDialog.removeDialog(); } for (CardInfoWindowDialog revealDialog : revealed.values()) { revealDialog.cleanUp(); revealDialog.removeDialog(); } for (CardInfoWindowDialog lookedAtDialog : lookedAt.values()) { lookedAtDialog.cleanUp(); lookedAtDialog.removeDialog(); } for (ShowCardsDialog pickTargetDialog : pickTarget) { pickTargetDialog.cleanUp(); pickTargetDialog.removeDialog(); } Plugins.instance.getActionCallback().hideOpenComponents(); try { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); } catch (InterruptedException ex) { logger.fatal("popupContainer error:", ex); } jPanel2.remove(bigCard); this.bigCard = null; }