From 6496e700ab055e170a48047f808312e0611ea1e3 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 3 Jun 2014 20:47:41 +0000 Subject: Fixed error handling git-svn-id: http://svn.miranda-ng.org/main/trunk@9410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Utils.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/PluginUpdater') diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 6d28fa0258..e628d5540d 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -219,15 +219,18 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT& baseUrl, SERVLIST& arHashes) pFileUrl.CRCsum = 0; HANDLE nlc; - BOOL ret = DownloadFile(&pFileUrl, nlc); + bool ret = DownloadFile(&pFileUrl, nlc); Netlib_CloseHandle(nlc); - if (!ret && !opts.bSilent) { - ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("An error occurred while checking new updates."), 1, 0); + if (!ret) { + if(!opts.bSilent) + ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("An error occurred while checking new updates."), 1, 0); return false; } - unzip(pFileUrl.tszDiskPath, tszTempPath, NULL,true); + if(!unzip(pFileUrl.tszDiskPath, tszTempPath, NULL,true)) + return false; + DeleteFile(pFileUrl.tszDiskPath); TCHAR tszTmpIni[MAX_PATH] = {0}; -- cgit v1.2.3