From fe4f6dbc1b5a4e25b51c3b91b2983cba06d712e8 Mon Sep 17 00:00:00 2001 From: dmfenton Date: Thu, 4 Jun 2015 11:59:22 -0400 Subject: [PATCH] adds check for empty info --- CHANGELOG.md | 4 ++++ lib/Local.js | 6 +++++- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb953aa60..2869c38de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.11] - 2015-06-04 +### Changed +* Local cache get info now returns error if info does not exist + ## [2.1.10] - 2015-06-02 ### Changed * adding an object id to the list of fields when its missing for CSV data diff --git a/lib/Local.js b/lib/Local.js index b83a5604b..e0e236f12 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -25,7 +25,11 @@ module.exports = { }, getInfo: function( key, callback ){ - callback(null, this.store[key].info); + if (this.store[key] && this.store[key].info) { + callback(null, this.store[key].info); + } else { + callback('info not found', false) + } }, updateInfo: function( key, info, callback ){ diff --git a/package.json b/package.json index a3aeead5a..872a13917 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "koop", - "version": "2.1.10", + "version": "2.1.11", "description": "A node module/express middleware for converting GeoJSON to Esri Feature Services.", "main": "index.js", "scripts": {