Commit 322884fae5de156abda937de36695f8e674737e6

Authored by Matti Virkkunen
1 parent ac6f689c

Counter-hack the hacks in bitlbee (fixes #34)

libpurple/purpleline_login.cpp
... ... @@ -31,7 +31,10 @@ void PurpleLine::login_start() {
31 31 purple_connection_set_state(conn, PURPLE_CONNECTING);
32 32 purple_connection_update_progress(conn, "Logging in", 0, 3);
33 33  
34   - std::string auth_token = purple_account_get_string(acct, LINE_ACCOUNT_AUTH_TOKEN, "");
  34 + // The hacks in bitlbee apparently can make this return NULL instead of "" as it should.
  35 + // This is a counter-hack.
  36 + const char *c_auth_token = purple_account_get_string(acct, LINE_ACCOUNT_AUTH_TOKEN, "");
  37 + std::string auth_token = (c_auth_token ? c_auth_token : "");
35 38  
36 39 if (auth_token != "") {
37 40 // There's a stored authentication token, see if it works
... ...