summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/embind/embind.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 83c3841f..ed659a2b 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -491,6 +491,10 @@ RegisteredPointer.prototype.isPolymorphic = function() {
RegisteredPointer.prototype.toWireType = function(destructors, handle) {
var fromRawType;
if (handle === null) {
+ if (this.pointeeType === this) {
+ throwBindingError('null is not a valid ' + this.name);
+ }
+
if (this.isSmartPointer) {
var ptr = this.rawConstructor(0, 0);
destructors.push(this.rawDestructor, ptr);