Changeset 4023 for trunk/console

Show
Ignore:
Timestamp:
02/22/05 00:36:37 (4 years ago)
Author:
emostar
Message:

Fix a crash that was caused my an uninitialized pointer. Also a few pointer checks..

Location:
trunk/console/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/console/src/console.cpp

    r3950 r4023  
    210210 
    211211  m_bExit = false; 
     212  cdkUserList = 0; 
    212213} 
    213214 
     
    291292  else 
    292293  { 
    293     ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 
     294    ICQOwner *o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    294295    if (o->Password()[0] == '\0') 
    295296    { 
  • trunk/console/src/console_print.cpp

    r3933 r4023  
    386386    s->pos = i; 
    387387    s->nPPID = (*it)->nPPID; 
    388     s->color = (*it)->color; 
     388        s->color = (*it)->color; 
    389389    sprintf(s->szId, "%s", (*it)->szId); 
    390390     
     
    416416 * CLicqConsole::UserListHighlight 
    417417 *-------------------------------------------------------------------------*/ 
    418 void CLicqConsole::UserListHighlight(chtype type, chtype input) { 
     418void CLicqConsole::UserListHighlight(chtype type, chtype input) 
     419{ 
    419420  // There has got to be a better way to do this... 
    420421  list <SScrollUser *>::iterator it; 
     
    428429  for (it = m_lScrollUsers.begin(); it != m_lScrollUsers.end(); it++) 
    429430  { 
    430     if ((*it)->pos == cdkUserList->currentItem + down) 
     431    if ((*it)->pos == (cdkUserList->currentItem + down)) 
    431432    { 
    432433      ICQUser *u = gUserManager.FetchUser((*it)->szId, (*it)->nPPID, LOCK_R); 
    433       if (u->NewMessages()) 
     434      if (u && u->NewMessages()) 
    434435        setCDKScrollHighlight(cdkUserList, COLOR_PAIR((*it)->color->nColor - 6) | type); 
    435436      else