[longomatch] Return a copy to prevent system template modification.



commit 370a972e1d4ee7fbe1c03e81f1eef8bc1192731e
Author: Julien Moutte <julien fluendo com>
Date:   Thu Jan 29 16:04:23 2015 +0100

    Return a copy to prevent system template modification.

 LongoMatch.Services/Services/TemplatesService.cs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Services/Services/TemplatesService.cs 
b/LongoMatch.Services/Services/TemplatesService.cs
index df884ef..afffdca 100644
--- a/LongoMatch.Services/Services/TemplatesService.cs
+++ b/LongoMatch.Services/Services/TemplatesService.cs
@@ -133,7 +133,8 @@ namespace LongoMatch.Services
                        
                        template = systemTemplates.FirstOrDefault (t => t.Name == name);
                        if (template != null) {
-                               return template;
+                               // Return a copy to prevent modification of system templates.
+                               return Cloner.Clone (template);
                        } else {
                                Log.Information ("Loading template " + name);
                                template = (T)methodLoad.Invoke (null, new object[] { GetPath(name) });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]