Fix crash when model baking fails

This commit is contained in:
embeddedt 2026-01-03 15:29:05 -05:00
parent f9cce166d1
commit f14bfa56e1
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -181,7 +181,13 @@ public class DynamicModelSystem {
if (DEBUG_DYNAMIC_MODEL_LOADING) {
ModernFix.LOGGER.info("Baking {}", key);
}
return baker.apply(key, unbaked);
var bakerResult = baker.apply(key, unbaked);
if (bakerResult == null) {
ModernFix.LOGGER.warn("Baker has returned null for {}", key);
return NULL_BAKED;
} else {
return bakerResult;
}
} else {
return NULL_BAKED;
}