From a34904a4d421399fc1a91c5cc229bd92353840d3 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sun, 22 Dec 2019 12:37:47 +0100 Subject: [PATCH] Fix an issue with empty payloads --- ViewModels/LumiaV2UnlockBootViewModel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ViewModels/LumiaV2UnlockBootViewModel.cs b/ViewModels/LumiaV2UnlockBootViewModel.cs index a8c104c..3c57b90 100644 --- a/ViewModels/LumiaV2UnlockBootViewModel.cs +++ b/ViewModels/LumiaV2UnlockBootViewModel.cs @@ -704,7 +704,11 @@ namespace WPinternals // // If you do not order payloads like this, you will get an error, most likely hash mismatch // - FlashingPayload[] payloads = GetNonOptimizedPayloads(FlashParts, FFU.ChunkSize, (uint)(Info.WriteBufferSize / FFU.ChunkSize), SetWorkingStatus, UpdateWorkingStatus).OrderBy(x => x.TargetLocations.Count()).ToArray(); + FlashingPayload[] payloads = new FlashingPayload[0]; + if (FlashParts != null) + { + payloads = GetNonOptimizedPayloads(FlashParts, FFU.ChunkSize, (uint)(Info.WriteBufferSize / FFU.ChunkSize), SetWorkingStatus, UpdateWorkingStatus).OrderBy(x => x.TargetLocations.Count()).ToArray(); + } bool AssumeImageHeaderFallsInGap = true; bool AllocateAsyncBuffersOnPhone = true;