8000 bug #30973 [WebProfiler] Fix Javascript error when using custom stopw… · symfony/symfony@9b9d416 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b9d416

Browse files
committed
bug #30973 [WebProfiler] Fix Javascript error when using custom stopwatch categories (curry684)
This PR was squashed before being merged into the 4.3-dev branch (closes #30973). Discussion ---------- [WebProfiler] Fix Javascript error when using custom stopwatch categories Fixes #30745 | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30745 | License | MIT Made the getter do lazy creation so it can dynamically adapt to whatever it's given. Commits ------- e991472 [WebProfiler] Fix Javascript error when using custom stopwatch categories
2 parents f539932 + e991472 commit 9b9d416

File tree

1 file changed

+2
-2
lines changed
  • src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ class Legend {
252252
}
253253

254254
get(category) {
255-
return this.categories.find(element => element.value === category);
255+
return this.categories.find(element => element.value === category) || this.createCategory(category);
256256
}
257257

258258
getClassname(category) {
259-
return this.classnames[category];
259+
return this.classnames[category] || '';
260260
}
261261

262262
getSectionClassname() {

0 commit comments

Comments
 (0)
0