From 446e994ff07828adf1bce303188de310a2c86370 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Sat, 6 Jul 2024 22:25:18 -0400 Subject: [PATCH] fix(handbook): Skip reading handbook from resources if it is disabled --- .../server/http/documentation/HandbookHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java index e4de100e0..f896f2151 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java @@ -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) {