mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Add try/catch to FContainer::draw() so screen doesn't bug out when something throws an exception during rendering
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.error.BugReporter;
|
||||
|
||||
public abstract class FContainer extends FDisplayObject {
|
||||
private final ArrayList<FDisplayObject> children = new ArrayList<FDisplayObject>();
|
||||
@@ -38,6 +39,7 @@ public abstract class FContainer extends FDisplayObject {
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
try {
|
||||
drawBackground(g);
|
||||
|
||||
boolean needOverlayDrawn = true;
|
||||
@@ -67,6 +69,10 @@ public abstract class FContainer extends FDisplayObject {
|
||||
drawOverlay(g);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
BugReporter.reportException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawOverlay(Graphics g) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user