Prevent crash when winning quest match

This commit is contained in:
drdev
2014-07-16 03:32:46 +00:00
parent b89672a45f
commit 8a681df8e6

View File

@@ -16,6 +16,7 @@
*/
package forge.screens.match.winlose;
import forge.FThreads;
import forge.GuiBase;
import forge.LobbyPlayer;
import forge.assets.FSkinColor;
@@ -133,19 +134,24 @@ public class QuestWinLose extends ControlWinLose {
if (!lastGame.getMatch().isMatchOver()) {
getView().getBtnQuit().setText("Quit (-15 Credits)");
return isAnte;
} else {
}
else {
getView().getBtnContinue().setVisible(false);
if (wonMatch) {
getView().getBtnQuit().setText("Great!");
} else {
}
else {
getView().getBtnQuit().setText("OK");
}
}
//invoke remaining logic in background thread so dialogs can be shown
FThreads.invokeInBackgroundThread(new Runnable() {
@Override
public void run() {
// TODO: We don't have a enum for difficulty?
int difficulty = qData.getAchievements().getDifficulty();
final int wins = qData.getAchievements().getWin();
// Win case
if (wonMatch) {
@@ -192,7 +198,8 @@ public class QuestWinLose extends ControlWinLose {
awardBooster();
}
}
}
});
return true;
}
@@ -607,7 +614,6 @@ public class QuestWinLose extends ControlWinLose {
*
*/
private void awardBooster() {
List<PaperCard> cardsWon = null;
if (qData.getFormat() == null) {