Permalink
Browse files

Fix crash in webadmin when adding a new user.

My recent patch, which added ability to put arbitrary bindhost when
global list is missing, broke it...

Thanks to Jord for reporting it.
  • Loading branch information...
1 parent ce6a9ce commit 6876961b791fd00e70958a10af4a4528550c259f @DarthGandalf DarthGandalf committed Apr 7, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 modules/webadmin.cpp
@@ -970,8 +970,10 @@ class CWebAdminMod : public CModule {
Tmpl["BindHostEdit"] = "true";
const VCString& vsBindHosts = CZNC::Get().GetBindHosts();
if (vsBindHosts.empty()) {
- Tmpl["BindHost"] = pUser->GetBindHost();
- Tmpl["DCCBindHost"] = pUser->GetDCCBindHost();
+ if (pUser) {
+ Tmpl["BindHost"] = pUser->GetBindHost();
+ Tmpl["DCCBindHost"] = pUser->GetDCCBindHost();
+ }
} else {
bool bFoundBindHost = false;
bool bFoundDCCBindHost = false;

0 comments on commit 6876961

Please sign in to comment.