sailorproject / sailor

A Lua MVC Web Framework.
MIT License
921 stars 125 forks source link

fix: simplify check for default_error404 #107

Closed luisbg closed 8 years ago

luisbg commented 8 years ago

If sailor.conf.default_error404 is not defined, it is nil which will resolve to false with ~= ''. No need to check twice.

luisbg commented 8 years ago

Starting to read the flow of the code. From src/sailor.lua to conf, to controller, to view, to model.

:smile:

Etiene commented 8 years ago

Wait! It's supposed to get into the if only when there's a default error page. Nil is different from empty string and it would enter in the if, that's not the desired behavior, both checks are necessary... ^_^

luisbg commented 8 years ago

Oh! Sorry.

The code should check that it is not nil. I missunderstood the purpose of the check. My bad.

Closing the PR.

Etiene commented 8 years ago

no worries! :)