1
0
Fork 0
mirror of https://gitlab.com/Syping/mayu synced 2024-11-22 03:50:22 +01:00

abort work when parse_hosts fail

This commit is contained in:
Syping 2018-05-15 09:55:23 +02:00
parent 2f6507f7c5
commit e06f1288da

View file

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