diff --git a/modules/controlpanel.cpp b/modules/controlpanel.cpp index 3aae9151..637dee0b 100644 --- a/modules/controlpanel.cpp +++ b/modules/controlpanel.cpp @@ -452,6 +452,11 @@ class CAdminMod : public CModule { CIRCNetwork *pNetwork = nullptr; + if (sVar.empty()) { + PutModule("Usage: GetNetwork [username] [network]"); + return; + } + if (sUsername.empty()) { pNetwork = CModule::GetNetwork(); } else { @@ -466,11 +471,6 @@ class CAdminMod : public CModule { } } - if (!pNetwork) { - PutModule("Usage: GetNetwork "); - return; - } - if (sVar.Equals("nick")) { PutModule("Nick = " + pNetwork->GetNick()); } else if (sVar.Equals("altnick")) { @@ -507,6 +507,11 @@ class CAdminMod : public CModule { CUser *pUser = nullptr; CIRCNetwork *pNetwork = nullptr; + if (sValue.empty()) { + PutModule("Usage: SetNetwork "); + return; + } + if (sUsername.empty()) { pUser = GetUser(); pNetwork = CModule::GetNetwork(); @@ -522,11 +527,6 @@ class CAdminMod : public CModule { } } - if (!pNetwork) { - PutModule("Usage: SetNetwork "); - return; - } - if (sVar.Equals("nick")) { pNetwork->SetNick(sValue); PutModule("Nick = " + pNetwork->GetNick());