]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Don't call the OnChangeRealHost event when initialising a user.
authorSadie Powell <sadie@witchery.services>
Thu, 29 Oct 2020 12:50:55 +0000 (12:50 +0000)
committerSadie Powell <sadie@witchery.services>
Thu, 29 Oct 2020 12:50:55 +0000 (12:50 +0000)
Fixes a (git only) crash when a user gets xlined before they have
been initialised.

src/users.cpp

index a99b51c2ce714cd069f30527d39b089063774f3c..7a11f22c8900e60a37e9a5c57c0d177ad9527e9c 100644 (file)
@@ -1075,7 +1075,10 @@ void User::ChangeRealHost(const std::string& host, bool resetdisplay)
        if (!changehost)
                return;
 
-       FOREACH_MOD(OnChangeRealHost, (this, host));
+       // Don't call the OnChangeRealHost event when initialising a user.
+       if (!realhost.empty())
+               FOREACH_MOD(OnChangeRealHost, (this, host));
+
        realhost = host;
        this->InvalidateCache();
 }