mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 14:22:34 +00:00
avoid null callback
This commit is contained in:
parent
8239bcd0b5
commit
0a94d1e475
1 changed files with 5 additions and 2 deletions
|
@ -41,8 +41,11 @@ class ASpellWorker
|
|||
output = output + chunk
|
||||
# We receive the language code from Aspell as the end of data marker
|
||||
if chunk.toString().match(endMarker)
|
||||
@callback(null, output.slice())
|
||||
@callback = null # only allow one callback in use
|
||||
if @callback?
|
||||
@callback(null, output.slice())
|
||||
@callback = null # only allow one callback in use
|
||||
else
|
||||
logger.err process: @pipe.pid, lang: @language, "end of data marker received when callback already used"
|
||||
@state = 'ready'
|
||||
output = ""
|
||||
error = ""
|
||||
|
|
Loading…
Reference in a new issue