throw Excepton in Dart controller if viewer null

This commit is contained in:
Nick Fisher
2023-10-03 00:19:59 +08:00
parent d6e527f3c0
commit df3bddcd86
2 changed files with 6 additions and 4 deletions

View File

@@ -142,6 +142,10 @@ class FilamentControllerFFI extends FilamentController {
renderCallback,
renderCallbackOwner);
if (_viewer!.address == 0) {
throw Exception("Failed to create viewer. Check logs for details");
}
_lib.create_swap_chain_ffi(
_viewer!, Pointer<Void>.fromAddress(surfaceAddress), width, height);
if (nativeTexture != 0) {