Brian Gough 10 лет назад
Родитель
Сommit
0a94d1e475
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      services/spelling/app/coffee/ASpellWorker.coffee

+ 5 - 2
services/spelling/app/coffee/ASpellWorker.coffee

@@ -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 = ""