Skip to content

Commit 2729976

Browse files
committed
don't allow title strings to be set to null
1 parent d40239a commit 2729976

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/to/us/tf/DeathSpectating/tasks/SpectateTask.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public String getUnformattedTitle()
7171

7272
public void setUnformattedTitle(String unformattedTitle)
7373
{
74+
if (unformattedTitle == null)
75+
unformattedTitle = "";
7476
this.unformattedTitle = unformattedTitle;
7577
}
7678

@@ -81,6 +83,8 @@ public String getUnformattedSubTitle()
8183

8284
public void setUnformattedSubTitle(String unformattedSubTitle)
8385
{
86+
if (unformattedSubTitle == null)
87+
unformattedSubTitle = "";
8488
this.unformattedSubTitle = unformattedSubTitle;
8589
}
8690

@@ -95,7 +99,7 @@ public void run()
9599
return;
96100
}
97101

98-
if (ticks % 10 == 0)
102+
if (ticks % 10 == 0 && !(unformattedTitle.isEmpty() && unformattedSubTitle.isEmpty()))
99103
{
100104
int seconds = (int)ticks / 20;
101105
String title = instance.getConfigManager().formatter(unformattedTitle, seconds, score);

0 commit comments

Comments
 (0)