mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Fixing NPE in VLog and VStack that pops up 10x tournament
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package forge.screens.match.views;
|
package forge.screens.match.views;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
@@ -176,10 +177,13 @@ public enum VLog implements IVDoc<CLog> {
|
|||||||
private List<GameLogEntry> getNewGameLogEntries(final GameView model) {
|
private List<GameLogEntry> getNewGameLogEntries(final GameView model) {
|
||||||
String logEntryType = FModel.getPreferences().getPref(FPref.DEV_LOG_ENTRY_TYPE);
|
String logEntryType = FModel.getPreferences().getPref(FPref.DEV_LOG_ENTRY_TYPE);
|
||||||
GameLogEntryType logVerbosityFilter = GameLogEntryType.valueOf(logEntryType);
|
GameLogEntryType logVerbosityFilter = GameLogEntryType.valueOf(logEntryType);
|
||||||
List<GameLogEntry> logEntries = model.getGameLog().getLogEntries(logVerbosityFilter);
|
if (model != null && model.getGameLog() != null) {
|
||||||
// Set subtraction - remove all log entries from new list which are already displayed.
|
List<GameLogEntry> logEntries = model.getGameLog().getLogEntries(logVerbosityFilter);
|
||||||
logEntries.removeAll(this.displayedLogEntries);
|
// Set subtraction - remove all log entries from new list which are already displayed.
|
||||||
return logEntries;
|
logEntries.removeAll(this.displayedLogEntries);
|
||||||
|
return logEntries;
|
||||||
|
}
|
||||||
|
return new ArrayList<GameLogEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNewLogEntriesToJPanel(List<GameLogEntry> newLogEntries) {
|
private void addNewLogEntriesToJPanel(List<GameLogEntry> newLogEntries) {
|
||||||
|
|||||||
@@ -118,6 +118,11 @@ public enum VStack implements IVDoc<CStack> {
|
|||||||
|
|
||||||
public void updateStack() {
|
public void updateStack() {
|
||||||
final GameView model = MatchUtil.getGameView();
|
final GameView model = MatchUtil.getGameView();
|
||||||
|
|
||||||
|
if (model == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final FCollectionView<StackItemView> items = model.getStack();
|
final FCollectionView<StackItemView> items = model.getStack();
|
||||||
tab.setText("Stack : " + items.size());
|
tab.setText("Stack : " + items.size());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user