Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f156cb31 authored by Roozbeh Pournader's avatar Roozbeh Pournader
Browse files

Make unicodeWrap() return null if the input string is null.

Previously, a NullPointerException was raised if the input was null.

Bug: 12894042
Change-Id: I5c5db484e5659659c1da91079adcba773ba7d83d
parent 6d54f81a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -377,9 +377,11 @@ public final class BidiFormatter {
     *        See {@link TextDirectionHeuristics} for pre-defined heuristics.
     * @param isolate Whether to directionally isolate the string to prevent it from garbling the
     *     content around it
     * @return Input string after applying the above processing.
     * @return Input string after applying the above processing. {@code null} if {@code str} is
     *     {@code null}.
     */
    public String unicodeWrap(String str, TextDirectionHeuristic heuristic, boolean isolate) {
        if (str == null) return null;
        final boolean isRtl = heuristic.isRtl(str, 0, str.length());
        StringBuilder result = new StringBuilder();
        if (getStereoReset() && isolate) {