mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
${h.breakableString(…)} might be called with a null argument if something is broken.
For robustness, pass on the null to Jelly rather than failing page rendering.
This commit is contained in:
1 parent
87e66570b8
commit
3f2958795c
2 files changed
+5
-2
No files matched your search
@@ -36,7 +36,7 @@ import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import jenkins.model.Jenkins;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -322,6 +322,7 @@ public class FunctionsTest {
|
||||
assertBrokenAs("<<a<bc<def<ghi<", "", "<", "<a", "<bc", "<def", "<ghi", "<");
|
||||
assertBrokenAs("H,e.l/l:o=w_o+|d", "H", ",e", ".l", "/l", ":o", "=w", "_o", "+|d");
|
||||
assertBrokenAs("a¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷ", "a¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷ", "a¶‱ﻷa¶‱ﻷa¶‱ﻷ");
|
||||
assertNull(Functions.breakableString(null));
|
||||
}
|
||||
|
||||
private void assertBrokenAs(String plain, String... chunks) {
|
||||
|
||||
Reference in new issue
Block a user