mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
Fix deferred null.
This commit is contained in:
@@ -61,9 +61,21 @@ public class PolycentricModelLoader implements ModelLoader<String, ByteBuffer> {
|
||||
_deferred.invokeOnCompletion(throwable -> {
|
||||
if (throwable != null) {
|
||||
callback.onLoadFailed(new Exception(throwable));
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
Deferred<ByteBuffer> deferred = _deferred;
|
||||
if (deferred == null) {
|
||||
callback.onLoadFailed(new Exception("Deferred is null"));
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
ByteBuffer completed = deferred.getCompleted();
|
||||
if (completed != null) {
|
||||
callback.onDataReady(completed);
|
||||
} else {
|
||||
callback.onLoadFailed(new Exception("Completed is null"));
|
||||
}
|
||||
final ByteBuffer completed = _deferred.getCompleted();
|
||||
callback.onDataReady(completed);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user