diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index 032c27bb..055f860f 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -127,12 +127,16 @@ namespace PARR.EsppSync foreach (PropertyInfo property in properties) { - var value = property.GetValue(dbObjectInEsppObject)?.ToString(); + var type = property.PropertyType; + if(type == typeof(string)){ + // только для стрингов проверяем шорткоды + var value = property.GetValue(dbObjectInEsppObject)?.ToString(); - if (value != null) - { - var processedValue = await shortcodesService.ApplyShortcodesAsync(value, templateForShortcodes); - property.SetValue(dbObjectInEsppObject, processedValue); + if (value != null) + { + var processedValue = await shortcodesService.ApplyShortcodesAsync(value, templateForShortcodes); + property.SetValue(dbObjectInEsppObject, processedValue); + } } }