don't die without tags in range
[Biblio-RFID.git] / 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} );