[asterisk-scf-commits] asterisk-scf/release/servicediscovery.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jun 5 13:40:52 CDT 2012


branch "master" has been updated
       via  ae2062f763a3dd9e58c13f8253f1e946fe0775bb (commit)
      from  f8976984cbb446e42c72161be404aee13380a2bb (commit)

Summary of changes:
 src/ServiceLocator.cpp |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit ae2062f763a3dd9e58c13f8253f1e946fe0775bb
Author: David M. Lee <dlee at digium.com>
Date:   Tue Jun 5 10:39:41 2012 -0500

    Fixed NPEs when failing to contact replicator.

diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 2a647ed..29e866c 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -448,7 +448,6 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
             {
                 lg(Error) << "Operating in replica group with no access to state replicator defined!" << endl;
                 lg(Error) << "--- Check config file for <servicename>.StateReplicator.Proxy setting, or run standalone." << endl;
-                assert(false);
             }
 
             lg(Info) << "Operating as a standby replica." << endl;
@@ -498,9 +497,8 @@ void ServiceLocatorApp::activated()
 {
     lg(Info) << "App activated callback entered.";
 
-    if (!mStandalone)
+    if (!mStandalone && mStateReplicator)
     {
-        
         lg(Info) << "  Removing listener from Replicator";
         // Stop listening to state replicator.
         mStateReplicator->removeListener(AsteriskSCF::Operations::createContext(), mReplicatorListenerProxy);
@@ -520,7 +518,7 @@ void ServiceLocatorApp::activated()
 
 void ServiceLocatorApp::onStandby()
 {
-    if (!mStandalone)
+    if (!mStandalone && mStateReplicator)
     {
         // Listen to state replicator.
         mStateReplicator->addListener(AsteriskSCF::Operations::createContext(), mReplicatorListenerProxy);

-----------------------------------------------------------------------


-- 
asterisk-scf/release/servicediscovery.git



More information about the asterisk-scf-commits mailing list