poeticninja / hapi-assets

Load assets in views based on node environment.
MIT License
16 stars 3 forks source link

Fix issue with error when the context object is not set #1

Closed briandela closed 10 years ago

briandela commented 10 years ago

I noticed that the hapi-assets plugin fails when the context is not already set in the reply.view() call. For example, if you were to do something like:

handler: function(request, reply){
          // Render the view (response.source.context will not be set)
            reply.view('index');
        },
...
handler: function(request, reply){
          // Render the view (response.source.context will be set as we are passing in an object)
            reply.view('index', { title: 'hi!'');
        },

This PR addresses that issue.

briandela commented 10 years ago

I forgot to update the version in the package.json. Sorry for that.

poeticninja commented 10 years ago

Good catch! Thanks for that!