Fix bug referencing invalid value from cache
This commit is contained in:
@@ -119,7 +119,9 @@ function getWxWeatherData( location, callback ) {
|
|||||||
key: "yesterdayHumidity",
|
key: "yesterdayHumidity",
|
||||||
location: location
|
location: location
|
||||||
}, function( record ) {
|
}, function( record ) {
|
||||||
weather.yesterdayHumidity = record.yesterdayHumidity;
|
if ( record ) {
|
||||||
|
weather.yesterdayHumidity = record.yesterdayHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
// Return the data to the callback function if successful
|
// Return the data to the callback function if successful
|
||||||
callback( weather );
|
callback( weather );
|
||||||
@@ -167,7 +169,9 @@ function getWeatherData( location, callback ) {
|
|||||||
key: "yesterdayHumidity",
|
key: "yesterdayHumidity",
|
||||||
location: location
|
location: location
|
||||||
}, function( record ) {
|
}, function( record ) {
|
||||||
weather.yesterdayHumidity = record.yesterdayHumidity;
|
if ( record ) {
|
||||||
|
weather.yesterdayHumidity = record.yesterdayHumidity;
|
||||||
|
}
|
||||||
|
|
||||||
// Return the data to the callback function if successful
|
// Return the data to the callback function if successful
|
||||||
callback( weather );
|
callback( weather );
|
||||||
|
|||||||
Reference in New Issue
Block a user