зеркало из https://github.com/mozilla/gecko-dev.git
Fix NullPointerException for "abc".match("a\");
This commit is contained in:
Родитель
6147ef7ade
Коммит
b060e6bd7e
|
@ -229,6 +229,8 @@ final class LineBuffer {
|
||||||
result = new String(buffer, stringStart,
|
result = new String(buffer, stringStart,
|
||||||
offset - stringStart - loseCR);
|
offset - stringStart - loseCR);
|
||||||
} else {
|
} else {
|
||||||
|
if (stringSoFar == null)
|
||||||
|
stringSoFar = new StringBuffer();
|
||||||
// Exclude cr as well as nl of newline. If offset is 0, then
|
// Exclude cr as well as nl of newline. If offset is 0, then
|
||||||
// hopefully fill() did the right thing.
|
// hopefully fill() did the right thing.
|
||||||
result = (stringSoFar.append(buffer, 0, offset - loseCR)).toString();
|
result = (stringSoFar.append(buffer, 0, offset - loseCR)).toString();
|
||||||
|
|
|
@ -229,6 +229,8 @@ final class LineBuffer {
|
||||||
result = new String(buffer, stringStart,
|
result = new String(buffer, stringStart,
|
||||||
offset - stringStart - loseCR);
|
offset - stringStart - loseCR);
|
||||||
} else {
|
} else {
|
||||||
|
if (stringSoFar == null)
|
||||||
|
stringSoFar = new StringBuffer();
|
||||||
// Exclude cr as well as nl of newline. If offset is 0, then
|
// Exclude cr as well as nl of newline. If offset is 0, then
|
||||||
// hopefully fill() did the right thing.
|
// hopefully fill() did the right thing.
|
||||||
result = (stringSoFar.append(buffer, 0, offset - loseCR)).toString();
|
result = (stringSoFar.append(buffer, 0, offset - loseCR)).toString();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче