Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix badmatch, when using session and calling non existent action #536

Merged

Conversation

tomekowal
Copy link

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 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.

danikp added a commit that referenced this pull request Jan 3, 2015
Fix badmatch, when using session and calling non existent action
@danikp danikp merged commit f7b4e91 into ChicagoBoss:master Jan 3, 2015
@danikp
Copy link
Contributor

danikp commented Jan 3, 2015

merged, thanks

@tomekowal tomekowal deleted the fix_badmatch_when_session_present branch January 4, 2015 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants