Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for defined client.

  • Loading branch information...
commit ccfe33901577f8bcbda5212bfefa9feee9717a21 1 parent e170a0d
Mark Lemming lemming552 authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Games/Lacuna/Client/Module.pm
8 lib/Games/Lacuna/Client/Module.pm
View
@@ -76,7 +76,10 @@ sub _generate_method_per_spec {
if ($client->debug) {
print STDERR "DEBUG: " . __PACKAGE__ . " request " . Data::Dumper::Dumper([$self->uri, $method_name, $params]);
}
- my $ret = $client->rpc->call($self->uri, $method_name, $params);
+ my $ret;
+ if (defined($client->rpc)) {
+ $ret = $client->rpc->call($self->uri, $method_name, $params);
+ }
if ($client->debug) {
print STDERR "DEBUG: " . __PACKAGE__ . " result " . Data::Dumper::Dumper($ret);
}
@@ -87,6 +90,9 @@ sub _generate_method_per_spec {
$ret->{result}{empire} ? $ret->{result}{empire}{rpc_count} :
$self->client->{rpc_count};
}
+ else {
+ $ret->{result} = "Undefined";
+ }
return $ret->{result};
};
Please sign in to comment.
Something went wrong with that request. Please try again.