mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
ace2_inner: when atext.text is "", replace with "\n"
The server is fine with atext.text being an empty string, but the front end is not, and crashes. It is not clear if this is a problem in the server or in the client code, and this is a client-side hack fix. The underlying problem needs to be investigated. See for reference: - https://github.com/ether/etherpad-lite/issues/3861
This commit is contained in:
parent
70990afd66
commit
51e40ddbc9
1 changed files with 16 additions and 0 deletions
|
@ -737,6 +737,22 @@ function Ace2Inner(){
|
|||
|
||||
function setDocAText(atext)
|
||||
{
|
||||
if (atext.text === "") {
|
||||
/*
|
||||
* The server is fine with atext.text being an empty string, but the front
|
||||
* end is not, and crashes.
|
||||
*
|
||||
* It is not clear if this is a problem in the server or in the client
|
||||
* code, and this is a client-side hack fix. The underlying problem needs
|
||||
* to be investigated.
|
||||
*
|
||||
* See for reference:
|
||||
* - https://github.com/ether/etherpad-lite/issues/3861
|
||||
*/
|
||||
console.warn('atext.text is an empty string(""). Replacing with "\\n". See issue #3861.');
|
||||
atext.text = "\n";
|
||||
}
|
||||
|
||||
fastIncorp(8);
|
||||
|
||||
var oldLen = rep.lines.totalWidth();
|
||||
|
|
Loading…
Reference in a new issue