summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-01-25 15:50:12 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-01-25 15:50:12 -0800
commit5ad00f82c6ade834e2cffddaa3293321aae18eb6 (patch)
tree2f05f6cfea1b5ee1bf827c020846400f9e7bc249 /lib
parent72bef516dc8082b4fb16c3bf26713b12d63ae6d1 (diff)
downloadnode-5ad00f82c6ade834e2cffddaa3293321aae18eb6.tar.gz
debugger: Don't crash when evaling buffer
Diffstat (limited to 'lib')
-rw-r--r--lib/_debugger.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js
index f501a7679..c23e3fc3d 100644
--- a/lib/_debugger.js
+++ b/lib/_debugger.js
@@ -141,7 +141,7 @@ exports.Client = Client;
Client.prototype._addHandle = function(desc) {
if (typeof desc != 'object' || typeof desc.handle != 'number') {
- throw new Error('bad type');
+ return;
}
this.handles[desc.handle] = desc;
@@ -428,7 +428,13 @@ Client.prototype.mirrorObject = function(handle, cb) {
for (var i = 0; i < handle.properties.length; i++) {
var value = res.body[handle.properties[i].ref];
- var mirrorValue = value.value ? value.value : value.text;
+ var mirrorValue;
+ if (value) {
+ mirrorValue = value.value ? value.value : value.text;
+ } else {
+ mirrorValue = '[?]';
+ }
+
if (Array.isArray(mirror) &&
typeof handle.properties[i].name != 'number') {