Don't blow up if collectionMethods/reosurceMethods are missing

This commit is contained in:
Vincent Fiduccia 2014-02-28 12:20:47 -07:00
parent 8cf81bb9cb
commit f4fe4e5642
1 changed files with 1 additions and 1 deletions

View File

@ -394,7 +394,7 @@ HTMLApi.prototype.operationInit = function(cb)
if ( schema )
{
var methods = ( type == 'collection' ? schema.collectionMethods : schema.resourceMethods );
var methods = ( type == 'collection' ? schema.collectionMethods : schema.resourceMethods ) || [];
var order = {'POST': 1, 'PUT': 2, 'DELETE': 3}
methods.sort(function(a,b) {
var ia = order[a];