This website works better with JavaScript.
Home
Explore
Help
Sign In
p3k
/
Atlas
mirror of
https://github.com/aaronpk/Atlas.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
0
Wiki
Activity
Browse Source
don't crash with an invalid api key
main
Aaron Parecki
6 years ago
parent
818da8cd29
commit
ab7506b66f
No known key found for this signature in database
GPG Key ID:
276C2817346D6056
2 changed files
with
4 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
controllers/weather.php
+3
-0
p3k/Weather.php
+ 1
- 1
controllers/weather.php
View File
@ -16,7 +16,7 @@ $app->get('/api/weather', function() use($app) {
}
else
{
json_response
(
$app
,
[
'error'
=>
'not_found'
,
'error_description'
=>
'No weather information was found for the requested location'
'error_description'
=>
'No weather information was found for the requested location
, or you used an invalid API key
'
]);
}
}
else
{
+ 3
- 0
p3k/Weather.php
View File
@ -9,6 +9,9 @@ class Weather {
$data
=
self
::
_fetch
(
$lat
,
$lng
,
$key
);
if
(
!
$data
)
return
null
;
if
(
!
property_exists
(
$data
,
'current_observation'
))
return
null
;
$current
=
$data
->
current_observation
;
$weather
=
[
Write
Preview
Loading…
Cancel
Save