diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2011-05-14 11:14:15 +0200 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2011-05-14 11:31:04 +0200 |
commit | 513659a6facfc17bc7191c79c4e78d178a076605 (patch) | |
tree | 15bb5378f692ed8b13047405cc2ead04f36c9429 /src/lanes.c | |
parent | 323cd4030044dd2f56ecdfddf360360f98f40362 (diff) | |
download | lanes-2.2.0.tar.gz lanes-2.2.0.tar.bz2 lanes-2.2.0.zip |
linda:send() raises an error when there is no data to send instead of silently doing nothing.v2.2.0
Diffstat (limited to '')
-rw-r--r-- | src/lanes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lanes.c b/src/lanes.c index e514e6b..ed54b0f 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -295,6 +295,12 @@ LUAG_FUNC( linda_send) | |||
295 | // make sure the keys are of a valid type | 295 | // make sure the keys are of a valid type |
296 | check_key_types( L, key_i, key_i); | 296 | check_key_types( L, key_i, key_i); |
297 | 297 | ||
298 | // make sure there is something to send | ||
299 | if( lua_gettop( L) == key_i) | ||
300 | { | ||
301 | luaL_error( L, "no data to send"); | ||
302 | } | ||
303 | |||
298 | // convert nils to some special non-nil sentinel in sent values | 304 | // convert nils to some special non-nil sentinel in sent values |
299 | keeper_toggle_nil_sentinels( L, key_i + 1, 1); | 305 | keeper_toggle_nil_sentinels( L, key_i + 1, 1); |
300 | 306 | ||