diff options
Diffstat (limited to 'system')
-rwxr-xr-x | system/include/emscripten/bind.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index e8a8dc1d..7dcfa61b 100755 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -543,7 +543,11 @@ namespace emscripten { typename smart_ptr_trait<SmartPointerType>::element_type* ptr, SmartPointerType* basePtr ) { - return new SmartPointerType(smart_ptr_trait<SmartPointerType>::share(*basePtr, ptr)); + if (ptr) { + return new SmartPointerType(smart_ptr_trait<SmartPointerType>::share(*basePtr, ptr)); + } else { + return new SmartPointerType; + } } template<typename PointerType> |