summaryrefslogtreecommitdiff
path: root/ext/dl/handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/handle.c')
-rw-r--r--ext/dl/handle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index 9ca2fa0a54..95b6dc74dc 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -52,11 +52,11 @@ rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self)
switch (rb_scan_args(argc, argv, "11", &lib, &flag)) {
case 1:
- clib = StringValuePtr(lib);
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 2:
- clib = StringValuePtr(lib);
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
cflag = NUM2INT(flag);
break;
default: