From 176f6508761f807660dcc23b77636519610310e6 Mon Sep 17 00:00:00 2001 From: oana Date: Fri, 10 Dec 2010 08:45:55 +0000 Subject: [PATCH] Bug fix: check pointer before using it. Fixed some spelling errors in messages presented to the user. git-svn-id: http://yate.null.ro/svn/yate/trunk@3939 acf43c95-373e-0410-b603-e72c3f656dc1 --- modules/server/subscription.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/server/subscription.cpp b/modules/server/subscription.cpp index 1aaee6b6..605d8988 100644 --- a/modules/server/subscription.cpp +++ b/modules/server/subscription.cpp @@ -2673,6 +2673,8 @@ void SubscriptionModule::expireSubscriptions() ObjList remove; for (unsigned int i = 0; i < n ; i++) { NamedString* ns = nl->getParam(i); + if (!ns) + continue; NamedPointer* np = static_cast(ns); EventUser* eu = static_cast(np->userData()); if (!eu) @@ -2777,7 +2779,7 @@ bool SubscriptionModule::commandExecute(String& retVal, const String& line) String contact = ""; // extractName(l.substr(user.length() + 2,-1),contact); if (user.null() || contact.null()) { - retVal << "Espected pair"; + retVal << "Expected pair"; DDebug(this,DebugInfo,"Command Execute 2 : return false user->null() || contact->null()"); return false; } @@ -2801,17 +2803,17 @@ bool SubscriptionModule::commandExecute(String& retVal, const String& line) contact = static_cast(o->get()); break; default: - retVal << "Espected pair"; + retVal << "Expected pair"; return false; } counter += 1; } if (user->null() || contact->null()) { - retVal << "Espected pair"; + retVal << "Expected pair"; return false; } // TODO unsubscribe the user - retVal << "PresenceUser: " << *user << " succesfuly unsubscribed from " << *contact << "'s presence"; + retVal << "PresenceUser: " << *user << " successfully unsubscribed from " << *contact << "'s presence"; } return false; }