don't die without tags in range
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 6 Aug 2010 15:40:49 +0000 (17:40 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 6 Aug 2010 15:40:49 +0000 (17:40 +0200)
scripts/RFID-JSONP-server.pl

index 6f6e3e3..176d7e6 100755 (executable)
@@ -95,7 +95,7 @@ sub http_server {
                                        close($fh);
                                }
                        } elsif ( $method =~ m{/scan} ) {
-                               my $tags = $rfid->scan;
+                               my $tags = $rfid->scan || {};
                                my $json = { time => time() };
                                foreach my $tag ( keys %$tags ) {
                                        my $hash = RFID::Biblio::RFID501->to_hash( $tags->{$tag} );