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