fix(handbook): Skip reading handbook from resources if it is disabled

This commit is contained in:
KingRainbow44 2024-07-06 22:25:18 -04:00
parent 655016c92e
commit 446e994ff0
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -25,8 +25,13 @@ public final class HandbookHandler implements Router {
* found.
*/
public HandbookHandler() {
if (!HANDBOOK.enable) {
this.serve = false;
return;
}
this.handbook = new String(FileUtils.readResource("/html/handbook.html"));
this.serve = HANDBOOK.enable && this.handbook.length() > 0;
this.serve = !this.handbook.isEmpty();
var server = HANDBOOK.server;
if (this.serve && server.enforced) {