Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

protect against occasional non-strings reading YAML parse

  • Loading branch information...
commit e8727cdb39b09499aadd966226d5ee9edde696f9 1 parent 6dac8e5
Andrew Houghton authored September 24, 2011

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  lib/beanstalk_client.js
6  lib/beanstalk_client.js
@@ -7,6 +7,10 @@ var events = require('events'),
7 7
 // because yaml doesn't like beanstalk
8 8
 var yaml = new function() {
9 9
 	this.eval = function(str) {
  10
+		if (!str.replace) {
  11
+			return str;
  12
+		}
  13
+
10 14
 		// YAML sucks, reg exp to make it working(ish)
11 15
 		var corrected = str.replace(/\n-\ ([\w\d_-]+)/mig, '\n  - \'$1\'') //indent list
12 16
 							.replace(/(\w)\-(\w)/mgi, '$1_$2') // replace minuses in hash names
@@ -435,4 +439,4 @@ var Beanstalk = function(server) {
435 439
 };
436 440
 
437 441
 exports.Client = Beanstalk;
438  
-exports.Debug = Debug;
  442
+exports.Debug = Debug;

0 notes on commit e8727cd

Please sign in to comment.
Something went wrong with that request. Please try again.