Fixes: NB#172477 - Contactsd crash is observed while receiving IM messages during...
authorJens Georg <jensg@openismus.com>
Mon, 12 Jul 2010 11:27:49 +0000 (14:27 +0300)
committerJens Georg <jensg@openismus.com>
Mon, 12 Jul 2010 12:10:04 +0000 (15:10 +0300)
commit3e3bfde0a4b4767424f29e8a9f074b0aa663fc9a
tree8f23f933cfceb14e1756b84803d2cb1ba14ba5ba
parente3a965b1a77bb1bc04c6d7e2c5a7c75a3fe35919
Fixes: NB#172477 - Contactsd crash is observed while receiving IM messages during on-going voip call

Bug: 172477
RevBy: people-review
Details:

Two issues:
operator[] on QHash _inserts_ an empty element if the key isn't found, so
there's a chance to have a null pointer in that map. Replaced with
const_iterator and .find()

Second: There is a check for invalid pointer, but it is checked after the
first use.

The code of the original bug didn't have any check in there, so making sure
there's no null pointer in the list (at least accidently) and moving the check
should fix the bug.
plugins/telepathy/trackersink.cpp