From 24e642a6c033d6357e53f040182bfb221e21d1e9 Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Mon, 5 Jun 2017 13:48:16 -0400
Subject: [PATCH] profilemodel: fix nullptr access

my previous patch [cm: replace BLANK() by default ctor]
causes a nullptr access in ProfileModelPrivate::slotAccountAdded()
There is a call to acc->contactMethod() that returns a nullptr.

I really tried to understand this call and its impact...
... no success!
Removing the line seems to have no effect during tests on Gnome client.

LRC is magic!

Change-Id: Icdd33989e5d90bfb93227d82354643269fe944ff
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
---
 src/profilemodel.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/profilemodel.cpp b/src/profilemodel.cpp
index 1641bac3..e12f1807 100644
--- a/src/profilemodel.cpp
+++ b/src/profilemodel.cpp
@@ -133,8 +133,6 @@ void ProfileModelPrivate::slotAccountAdded(Account* acc)
     currentNode->children << account_pro;
     q_ptr->endInsertRows();
 
-    acc->contactMethod()->setPerson(currentProfile->person());
-
     if (changed)
         currentProfile->save();
 }
-- 
GitLab