--- win32ole.c~ Sun Dec 13 18:19:20 2015 +++ win32ole.c Sat Dec 26 23:52:40 2015 @@ -864,6 +864,10 @@ /* do not type-conversion here to prevent from other arguments * changing (if exist) */ Check_Type(vstr, T_STRING); + if (RSTRING_LEN(vstr) == 0) + { + return NULL; + } enc = rb_enc_get(vstr); @@ -1572,9 +1576,17 @@ case VT_BSTR: { if(V_ISBYREF(pvar)) - obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE); + { + obj = (SysStringLen(*V_BSTRREF(pvar)) == 0) + ? rb_str_new2("") + : ole_wc2vstr(*V_BSTRREF(pvar), FALSE); + } else - obj = ole_wc2vstr(V_BSTR(pvar), FALSE); + { + obj = (SysStringLen(V_BSTR(pvar)) == 0) + ? rb_str_new2("") + : ole_wc2vstr(V_BSTR(pvar), FALSE); + } break; }