Skip to content

Commit 9e79da3

Browse files
ljyf5593barryvdh
authored andcommitted
fixed in ajax mode the pdo collector maybe empty (php-debugbar#349)
if the pdo collector is empty, the script will be throw error
1 parent 3e3dad6 commit 9e79da3

File tree

1 file changed

+4
-0
lines changed
  • src/DebugBar/Resources/widgets/sqlqueries

1 file changed

+4
-0
lines changed

src/DebugBar/Resources/widgets/sqlqueries/widget.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
this.$list.$el.appendTo(this.$el);
8888

8989
this.bindAttr('data', function(data) {
90+
// the PDO collector maybe is empty
91+
if (data.length <= 0) {
92+
return false;
93+
}
9094
this.$list.set('data', data.statements);
9195
this.$status.empty();
9296

0 commit comments

Comments
 (0)