mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
prevent NPE
This commit is contained in:
@@ -119,12 +119,14 @@ public class ImageCache {
|
||||
public static void disposeTextures() {
|
||||
CardRenderer.clearcardArtCache();
|
||||
//unload all cardsLoaded
|
||||
for (String fileName : cardsLoaded) {
|
||||
if (Forge.getAssets().manager().get(fileName, Texture.class, false) != null) {
|
||||
Forge.getAssets().manager().unload(fileName);
|
||||
if (cardsLoaded != null) {
|
||||
for (String fileName : cardsLoaded) {
|
||||
if (Forge.getAssets().manager().get(fileName, Texture.class, false) != null) {
|
||||
Forge.getAssets().manager().unload(fileName);
|
||||
}
|
||||
}
|
||||
cardsLoaded.clear();
|
||||
}
|
||||
cardsLoaded.clear();
|
||||
((Forge) Gdx.app.getApplicationListener()).needsUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user