mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-03-15 11:50:01 +01:00
Fix front-end crash when no twig collector exists (#312)
If the twig collector wasn’t used on a particular request, the twig widget crashes the client. Fix the bug by assuming a default array of zero templates. (For example, an AJAX call that didn’t construct a TwigCollector would trigger this crash.)
This commit is contained in:
parent
f7aa6884c2
commit
afee79a236
@ -68,7 +68,7 @@ class TwigCollector extends DataCollector implements Renderable, AssetProvider
|
||||
'icon' => 'leaf',
|
||||
'widget' => 'PhpDebugBar.Widgets.TemplatesWidget',
|
||||
'map' => 'twig',
|
||||
'default' => '[]'
|
||||
'default' => json_encode(array('templates' => array())),
|
||||
),
|
||||
'twig:badge' => array(
|
||||
'map' => 'twig.nb_templates',
|
||||
|
Loading…
x
Reference in New Issue
Block a user