Skip to content

Commit

Permalink
luv_process: ensure handle is not null
Browse files Browse the repository at this point in the history
the handle might have already been closed out, if it is NULL pretend
like nothing happened.
  • Loading branch information
philips authored and Brandon Philips committed Aug 14, 2012
1 parent 51ac5a8 commit eaa46eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/luv_process.c
Expand Up @@ -153,6 +153,9 @@ int luv_process_kill(lua_State* L) {
uv_process_t* handle = (uv_process_t*)luv_checkudata(L, 1, "process");
int signum = luaL_checkint(L, 2);

if (handle == NULL)
return 0;

if (uv_process_kill(handle, signum)) {
uv_err_t err = uv_last_error(luv_get_loop(L));
return luaL_error(L, "process_kill: %s", uv_strerror(err));
Expand Down

0 comments on commit eaa46eb

Please sign in to comment.