Stop logging exceptions when setting conversation information fails in ApplyTo().
authorDean
Wed, 02 Nov 2016 19:19:13 +0100
changeset 1409 d225ad16bc40
parent 1408 fcab46ae95b1
child 1410 462c4d0b0006
Stop logging exceptions when setting conversation information fails in ApplyTo().
PEPMessage.cs
--- a/PEPMessage.cs	Wed Nov 02 18:53:51 2016 +0100
+++ b/PEPMessage.cs	Wed Nov 02 19:19:13 2016 +0100
@@ -624,7 +624,7 @@
                 field.Value = this._PEPProtocolVersion;
                 optionalFields.Add(field);
             }
-            
+
             if ((alwaysAddOptFields) ||
                 (this._Rating != pEpRating.pEpRatingUndefined))
             {
@@ -633,7 +633,7 @@
                 field.Value = this._Rating.ToEngineString();
                 optionalFields.Add(field);
             }
-            
+
             // ReceivedOn
             recvSec = -1;
             if (this._ReceivedOn != null)
@@ -1363,11 +1363,20 @@
                     }
 
                     MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationIndexTracking, false);
-                    MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationTopic, this._ConversationTopic);
+
+                    if (string.IsNullOrEmpty(this._ConversationTopic))
+                    {
+                        // Clear the property value even if null
+                        MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationTopic, string.Empty);
+                    }
+                    else
+                    {
+                        MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationTopic, this._ConversationTopic);
+                    }
                 }
-                catch (Exception ex1)
+                catch
                 {
-                    Log.Warning("PEPMessage.ApplyTo: Failure setting conversation information. " + ex1.ToString());
+                    Log.Warning("PEPMessage.ApplyTo: Failure setting conversation information.");
                 }
 
                 /* Add internal properties