]> git.stg.codes - stg.git/commitdiff
Ticket 37. The object tariff definition moved into the if(newTariff)
authorElena Mamontova <helenh463@gmail.com>
Mon, 8 Aug 2016 07:26:03 +0000 (10:26 +0300)
committerElena Mamontova <helenh463@gmail.com>
Mon, 8 Aug 2016 07:26:03 +0000 (10:26 +0300)
    construction.

projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp

index b30b4e86d0fed47a16112dd85a2744df06e82e7a..841fafa118c54734fe91d396dbc682060955bdb2 100644 (file)
@@ -594,10 +594,10 @@ int CHG_USER::ApplyChanges()
 
     if (!m_ucr.tariffName.empty())
     {
 
     if (!m_ucr.tariffName.empty())
     {
-        const TARIFF * tariff = u->GetTariff();
         const TARIFF * newTariff = m_tariffs.FindByName(m_ucr.tariffName.const_data());
         if (newTariff)
         {
         const TARIFF * newTariff = m_tariffs.FindByName(m_ucr.tariffName.const_data());
         if (newTariff)
         {
+            const TARIFF * tariff = u->GetTariff();
             if (tariff->TariffChangeIsAllowed(*newTariff) == "")
             {
                 if (!u->GetProperty().tariffName.Set(m_ucr.tariffName.const_data(), &m_currAdmin, m_login, &m_store))
             if (tariff->TariffChangeIsAllowed(*newTariff) == "")
             {
                 if (!u->GetProperty().tariffName.Set(m_ucr.tariffName.const_data(), &m_currAdmin, m_login, &m_store))