nookieman/TeamMeet — pull request #120 by 0x64746b (2012-05-23 15:57:54+00:00)
Title: Fix sticky npe

So far, if the app was killed in a way that prevented `XMPPService::onDestroy()`
from being called (force close, adb install) while online, the existing
sticky `CONNECTED` intent wasn't cleared.

This led to `NullPointerException`s upon restart since the app registered that
orphaned intent, assumed it was connected and tried to execute actions that were
not sensible while offline.

This commit adds further and refines existing exception handling (so far only
attempts to access the roster were checked), so that such errors are handled
more gracefully.

NOTE: The current implementation doesn't actually fix the problem (orphaned
sticky intends are neither prevented nor cleared upon detection) but handles the
resulting errors more gracefully.

Closes #85.