From 53e947b01dfff25dbfefb8735e03e452caad2087 Mon Sep 17 00:00:00 2001 From: Izzy Date: Mon, 29 Oct 2018 19:08:30 +0100 Subject: [PATCH] deal correctly with "empty responses" from VT --- virustotal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virustotal.class.php b/virustotal.class.php index e88877d..3e3e856 100644 --- a/virustotal.class.php +++ b/virustotal.class.php @@ -39,7 +39,7 @@ class virustotal { * * response_code (int), verbose_msg (str) * * also hashes/identifiers: sha256, sha1, md5, scan_id, resource */ - protected $json_response = []; + public $json_response = []; /** ScanID we can use to query the state for this file * @class virustotal @@ -95,7 +95,7 @@ function rescan($hash,$maxage=7) { curl_close ($ch); $reply = json_decode($api_reply); - if ( property_exists($reply,'response_code') ) { + if ( is_object($reply) && property_exists($reply,'response_code') ) { $api_rc = $reply->response_code; } else { $api_rc = -99;