From a31671e2fb561f45c256c53f46287f0e84464631 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sun, 17 Jan 2016 21:48:35 +0100 Subject: [PATCH] Added protection against user destroying loc inadvertently --- Logic/Financial/FinancialAccount.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Logic/Financial/FinancialAccount.cs b/Logic/Financial/FinancialAccount.cs index 1df509c9..03635abf 100644 --- a/Logic/Financial/FinancialAccount.cs +++ b/Logic/Financial/FinancialAccount.cs @@ -395,8 +395,11 @@ namespace Swarmops.Logic.Financial // This is ok and can be thrown if OpenedYear throws because there are no transactions yet. } - SwarmDb.GetDatabaseForWriting().SetFinancialAccountName (Identity, value); - base.Name = value; + if (value != Name) // check that we're not setting value to the localized version, thereby destroying loc for other users + { + SwarmDb.GetDatabaseForWriting().SetFinancialAccountName (Identity, value); + base.Name = value; + } } }