File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/Symfony/Bridge/Twig/DataCollector Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,18 @@ public function lateCollect()
63
63
$ this ->data ['template_paths ' ] = array ();
64
64
65
65
$ templateFinder = function (Profile $ profile ) use (&$ templateFinder ) {
66
- if ($ profile ->isTemplate () && $ template = $ this ->twig ->load ($ profile ->getName ())->getSourceContext ()->getPath ()) {
67
- $ this ->data ['template_paths ' ][$ profile ->getName ()] = $ template ;
66
+ if ($ profile ->isTemplate ()) {
67
+ try {
68
+ $ template = $ this ->twig ->load ($ name = $ profile ->getName ());
69
+ } catch (\Twig_Error_Loader $ e ) {
70
+ $ template = null ;
71
+ }
72
+
73
+ if (null !== $ template && '' !== $ path = $ template ->getSourceContext ()->getPath ()) {
74
+ $ this ->data ['template_paths ' ][$ name ] = $ path ;
75
+ }
68
76
}
77
+
69
78
foreach ($ profile as $ p ) {
70
79
$ templateFinder ($ p );
71
80
}
You can’t perform that action at this time.
0 commit comments