Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit c22ba33

Browse files
committed
Return from routing middleware if 'route' prop isn't set on template. Fixes #57
1 parent fac91de commit c22ba33

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: lib/routing.js

+7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ const arrayOrString = (str) => {
1717
};
1818

1919
Routing = (template, settings, render, compile) => {
20+
check(template, Object);
2021
check(template.name, String);
22+
23+
if (template && !template.route) {
24+
Utils.Logger.info(`Cannot set up route for '${template.name}' mailer template - missing 'route' propery. See documentation.`, 'mailer');
25+
return;
26+
}
27+
2128
check(template.route.path, String);
2229
check(settings.routePrefix, String);
2330
check(render, Function);

0 commit comments

Comments
 (0)