Browse Source

Check for defined-ness of value instead of its truthiness

In some cases, the value is 0, like when returning whether or not a
checkbox is selected.
Daniel Gempesaw 11 years ago
parent
commit
921cb7be45
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Selenium/Remote/RemoteConnection.pm

+ 1 - 1
lib/Selenium/Remote/RemoteConnection.pm

@@ -131,7 +131,7 @@ sub _process_response {
         }
         elsif ($response->is_success) {
             $data->{'cmd_status'} = 'OK';
-            if (defined $decoded_json && $decoded_json->{'value'}) {
+            if (defined $decoded_json && defined $decoded_json->{'value'}) {
                 $data->{'cmd_return'} = $decoded_json->{'value'};
             }
             else {