From 2ba4b6f838d31b0e1f5cd3b989f0cc1354c77f3a Mon Sep 17 00:00:00 2001 From: RKrom Date: Thu, 2 Feb 2012 10:50:23 +0000 Subject: [PATCH] Only setting value if we can write them, this solved a problem with cloneTo for an ini configuration object. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1622 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Core/Objects.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GreenshotPlugin/Core/Objects.cs b/GreenshotPlugin/Core/Objects.cs index f791d66d9..a15fea655 100644 --- a/GreenshotPlugin/Core/Objects.cs +++ b/GreenshotPlugin/Core/Objects.cs @@ -63,7 +63,9 @@ namespace GreenshotPlugin.Core { PropertyInfo[] myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); foreach (PropertyInfo pi in myObjectProperties) { - pi.SetValue(destination, pi.GetValue(source, null), null); + if (pi.CanWrite) { + pi.SetValue(destination, pi.GetValue(source, null), null); + } } }