Fix bug referencing invalid value from cache

This commit is contained in:
Samer Albahra
2015-08-07 20:34:02 -05:00
parent 57b44e4dd6
commit 76acc76f0f

View File

@@ -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 );