diff --git a/model/CreditApi.class.php b/model/CreditApi.class.php index 116d646e..8b7fafe5 100644 --- a/model/CreditApi.class.php +++ b/model/CreditApi.class.php @@ -21,7 +21,9 @@ class CreditApi { $rawJSON = file_get_contents('https://spreadsheets.google.com/feeds/cells/1iOC1o5jq_4ySwRzsy2tZPPltw6Tbky2e3lDFdsWV8dU/okf1n52/public/full/R1C1?alt=json'); $json = $rawJSON ? json_decode($rawJSON, true) : []; - return isset($json['entry']) && isset($json['entry']['content']) ? $json['entry']['content']['$t'] : -1; + return isset($json['entry']) && isset($json['entry']['content']) && is_numeric($json['entry']['content']['$t'] ) ? + $json['entry']['content']['$t'] : + 6687; //fallback # } public static function getCreditsPerDollar($days)