mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-06 08:10:17 +00:00
Fix deferred null.
This commit is contained in:
parent
f9b772b729
commit
242728fbe7
1 changed files with 14 additions and 2 deletions
|
@ -61,9 +61,21 @@ public class PolycentricModelLoader implements ModelLoader<String, ByteBuffer> {
|
||||||
_deferred.invokeOnCompletion(throwable -> {
|
_deferred.invokeOnCompletion(throwable -> {
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
callback.onLoadFailed(new Exception(throwable));
|
callback.onLoadFailed(new Exception(throwable));
|
||||||
|
return Unit.INSTANCE;
|
||||||
}
|
}
|
||||||
final ByteBuffer completed = _deferred.getCompleted();
|
|
||||||
|
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);
|
callback.onDataReady(completed);
|
||||||
|
} else {
|
||||||
|
callback.onLoadFailed(new Exception("Completed is null"));
|
||||||
|
}
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue