abort work when parse_hosts fail

This commit is contained in:
Syping 2018-05-15 09:55:23 +02:00
parent 2f6507f7c5
commit e06f1288da
1 changed files with 8 additions and 2 deletions

View File

@ -360,8 +360,11 @@ void mayu::p_workHosts(const QList<QByteArray> &hostsArray)
#ifdef MAYU_UNIX
void mayu::p_workPing()
{
if (!p_hostsParsed)
if (!p_hostsParsed) {
parse_hosts();
if (!p_hostsParsed)
return;
}
QJsonObject jsonObject;
const QStringList hostsList = getHosts();
for (const QString &host : hostsList) {
@ -376,8 +379,11 @@ void mayu::p_workPing()
void mayu::p_workResolve()
{
if (!p_hostsParsed)
if (!p_hostsParsed) {
parse_hosts();
if (!p_hostsParsed)
return;
}
QJsonObject jsonObject;
const QStringList hostsList = getHosts();
for (const QString &host : hostsList) {