From 11112c57c6701f2233307b110cd2961efaf2fb00 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 5 Jan 2013 19:53:50 +0000 Subject: temporary fix for a crash in AddContact (fixes #156) git-svn-id: http://svn.miranda-ng.org/main/trunk@2983 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_addstn.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index 4cc2a34a90..22cf2b5ddc 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -35,7 +35,9 @@ static TCHAR name1[256]; INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) { PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam; - WIDATA *sData; + + if(!psr || !psr->email) + return 0; // search for existing contact HANDLE hContact = db_find_first(); @@ -75,7 +77,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) GetSvc(svc); // set settings by obtaining the default for the service if (psr->lastName[0] != 0) { - sData = GetWIData(svc); + WIDATA *sData = GetWIData(svc); db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap); db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL); } -- cgit v1.2.3