Преглед изворни кода

fix bug, jsonOps is array not string

Brian Gough пре 9 година
родитељ
комит
a3947c587f
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      services/document-updater/app/coffee/RedisManager.coffee

+ 5 - 4
services/document-updater/app/coffee/RedisManager.coffee

@@ -162,10 +162,11 @@ module.exports = RedisManager =
 				return callback(error)
 
 			jsonOps = appliedOps.map (op) -> JSON.stringify op
-			if jsonOps.indexOf("\u0000") != -1
-				error = new Error("null bytes found in jsonOps")
-				logger.error err: error, doc_id: doc_id, jsonOps: jsonOps, error.message
-				return callback(error)
+			for op in jsonOps
+				if op.indexOf("\u0000") != -1
+					error = new Error("null bytes found in jsonOps")
+					logger.error err: error, doc_id: doc_id, jsonOps: jsonOps, error.message
+					return callback(error)
 
 			newDocLines = JSON.stringify(docLines)
 			if newDocLines.indexOf("\u0000") != -1