Tell user what's going on before potential crash.

Custom modules compiled for older ZNC can crash ZNC.
Because now ZNC checks for list of available modules on startup in order
to check whether it's installed or not, it can crash right on startup.

Now it outputs nice message about checking for modules before that.

See github issue #172
This commit is contained in:
Alexey Sokolov
2012-05-27 12:58:30 +07:00
parent cab14055de
commit fa0132900e

View File

@@ -207,8 +207,10 @@ int main(int argc, char** argv) {
{
set<CModInfo> ssGlobalMods;
CUtils::PrintAction("Checking for list of available modules");
pZNC->GetModules().GetAvailableMods(ssGlobalMods, CModInfo::GlobalModule);
if (ssGlobalMods.empty()) {
CUtils::PrintStatus(false, "");
CUtils::PrintError("No modules found. Perhaps you didn't install ZNC properly?");
CUtils::PrintError("Read http://wiki.znc.in/Installation for instructions.");
if (!CUtils::GetBoolInput("Do you really want to run ZNC without any modules?", false)) {
@@ -216,6 +218,7 @@ int main(int argc, char** argv) {
return 1;
}
}
CUtils::PrintStatus(true, "");
}
if (isRoot()) {