Skip to content

Commit

Permalink
testing for package
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Dec 18, 2011
1 parent d10c715 commit 5d3d3da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ nodeDaveAPI.processAction = function(api, connection, next)
connection.validator = new templateValidator();
connection.validator.error = function(msg){ connection.error = msg; };

if(api.models.log != null){
if(api.models != null && api.models.log != null){
api.models.log.count({where: ["ip = ? AND createdAt > (NOW() - INTERVAL 1 HOUR)", connection.remoteIP]}).on('success', function(requestThisHourSoFar) {
connection.requestCounter = requestThisHourSoFar + 1;
if(connection.params.limit == null){ connection.params.limit = api.configData.defaultLimit; }
Expand Down Expand Up @@ -196,7 +196,7 @@ nodeDaveAPI.processAction = function(api, connection, next)
}

nodeDaveAPI.logAction = function(api, connection){
if(api.models.log != null){
if(api.models != null && api.models.log != null){
var logRecord = api.models.log.build({
ip: connection.remoteIP,
action: connection.action,
Expand Down

0 comments on commit 5d3d3da

Please sign in to comment.