Skip to content

Commit b18afc8

Browse files
committed
Only display selection list if there are snippets
Commit 4036bb1 (see #24) did not properly address this issue. Fixes #41
1 parent 83f2c6f commit b18afc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/snippets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jQuery(document).ready(function($) {
3737
var textarea = $(this);
3838

3939
// Only display snippets selector if there are any
40-
if (data.snippets) {
40+
if (Array.isArray(data.snippets) && data.snippets.length > 0) {
4141
try {
4242
// Create Snippets select
4343
var select = $("<select></select>");

0 commit comments

Comments
 (0)