summaryrefslogtreecommitdiffstats
path: root/lib/evendoors
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-07 12:08:32 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-07 12:08:32 +0200
commit9d44cb5ddc88a867668a3ff04917fab5e50b1974 (patch)
tree796d67c25cb0a2031288c7a6ca0a64e70bd9dd98 /lib/evendoors
parent2c4c391d054ddaf6c2f5caa6912d50c120285c42 (diff)
downloadedoors-ruby-9d44cb5ddc88a867668a3ff04917fab5e50b1974.zip
edoors-ruby-9d44cb5ddc88a867668a3ff04917fab5e50b1974.tar.gz
Room: route_p call error! when door_name is empty?
Diffstat (limited to 'lib/evendoors')
-rw-r--r--lib/evendoors/room.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index 2a38ac9..4214965 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -75,7 +75,9 @@ module EvenDoors
end
#
def route_p p, door_name
- if p.room.nil? or p.room==path
+ if door_name.empty?
+ p.error! EvenDoors::ERROR_ROUTE_NDN
+ elsif p.room.nil? or p.room==path
if door = @spots[door_name]
p.dst_done! door
else