From 9e10c2e2889e924f8354acc4d2712cb27abf430f Mon Sep 17 00:00:00 2001 From: how02 Date: Thu, 18 Apr 2024 04:14:37 +0300 Subject: [PATCH] Fixed a NullReferenceException --- Wino.Core/Synchronizers/GmailSynchronizer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Wino.Core/Synchronizers/GmailSynchronizer.cs b/Wino.Core/Synchronizers/GmailSynchronizer.cs index 217ad727..917e3493 100644 --- a/Wino.Core/Synchronizers/GmailSynchronizer.cs +++ b/Wino.Core/Synchronizers/GmailSynchronizer.cs @@ -904,9 +904,12 @@ namespace Wino.Core.Synchronizers // Local copy doesn't exists. Continue execution to insert mail copy. } - foreach (var labelId in message.LabelIds) + if (message.LabelIds is not null) { - packageList.Add(new NewMailItemPackage(mailCopy, mimeMessage, labelId)); + foreach (var labelId in message.LabelIds) + { + packageList.Add(new NewMailItemPackage(mailCopy, mimeMessage, labelId)); + } } return packageList;