ChicagoBoss/ChicagoBoss — pull request #536 by tomekowal (2014-12-29 10:52:49+00:00)
Title: Fix badmatch, when using session and calling non existent action

In `boss_controller_adapter_pmod:action/2` there was pattern match: `{CMod, _} = ControllerInstance`, which assumes, that `ControllerInstance` is two element tuple. Actually, it may be two element tuple `{CMod, RequestWrapper}` or three element tuple `{CMod, RequestWrapper, Session}`.

The line is was in the code, that handled actions which did not exist. It should return `undefined`, which causes returning 404, but because of `badmatch`, it returned "Error in controller, see console.log for details".

Changing pattern match to `CMod = element(1, ControllerInstance)` handles both cases and solves the problem.