From 8cf3ee7a102f0322c296f675fdaaae67eb027b97 Mon Sep 17 00:00:00 2001 From: Miquel Martinez Date: Mon, 28 Oct 2024 14:11:10 +0100 Subject: [PATCH] Update MAUI to v2.0.2 and Android to v10.0.2 --- ExampleAppMAUI/ExampleAppMAUI.csproj | 2 +- ExampleAppMAUI/MainPage.xaml.cs | 16 ++++++++++++---- README.md | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ExampleAppMAUI/ExampleAppMAUI.csproj b/ExampleAppMAUI/ExampleAppMAUI.csproj index d65f8be..f8b9848 100644 --- a/ExampleAppMAUI/ExampleAppMAUI.csproj +++ b/ExampleAppMAUI/ExampleAppMAUI.csproj @@ -75,7 +75,7 @@ - + diff --git a/ExampleAppMAUI/MainPage.xaml.cs b/ExampleAppMAUI/MainPage.xaml.cs index ea8886d..7f6b817 100644 --- a/ExampleAppMAUI/MainPage.xaml.cs +++ b/ExampleAppMAUI/MainPage.xaml.cs @@ -229,10 +229,18 @@ private void LoadFrameResult(byte[] frame) private static byte[] ImageToByteArrayAsync(string path) { var assem = Assembly.GetExecutingAssembly(); - using var stream = assem.GetManifestResourceStream(path); - byte[] bytesAvailable = new byte[stream.Length]; - stream.Read(bytesAvailable, 0, bytesAvailable.Length); - return bytesAvailable; + if (assem is not null) { + using var stream = assem.GetManifestResourceStream(path); + if(stream is not null) { + byte[] bytesAvailable = new byte[stream.Length]; + stream.Read(bytesAvailable, 0, bytesAvailable.Length); + return bytesAvailable; + } else { + return []; + } + } else { + return []; + } } diff --git a/README.md b/README.md index 2eb6725..ccb5c4c 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The **iProov.NET.MAUI** library is available at [nugets.org](https://www.nuget.o ``` - + ```