From a7d674275185399d112ce5f38365d0e2df1a6535 Mon Sep 17 00:00:00 2001 From: Mathis Waldmann Date: Wed, 28 Jul 2021 01:18:53 +0200 Subject: [PATCH] fixed StringIndexOutOfBounds exception --- src/com/sheepit/client/standalone/GuiTextOneLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/sheepit/client/standalone/GuiTextOneLine.java b/src/com/sheepit/client/standalone/GuiTextOneLine.java index 271a35c..0268bd5 100644 --- a/src/com/sheepit/client/standalone/GuiTextOneLine.java +++ b/src/com/sheepit/client/standalone/GuiTextOneLine.java @@ -209,7 +209,7 @@ public class GuiTextOneLine implements Gui { if (line.length() + project.length() > 120) { // If the line without the project name is already >120 characters (might happen if the user has thousands of frames and millions of points in the // session + is exiting after all frames are uploaded) then set the line to 117c to avoid a negative number exception in substring function - int lineLength = (line.length() >= 120 ? 117 : line.length()); + int lineLength = Math.min(line.length(), 117); line = String.format(line, project.substring(0, 117 - lineLength) + "..."); } else {