Skip to content

Commit 42d1506

Browse files
author
Alberto Iglesias
committed
fix: check that sounds are loaded in seek (returning current position)
1 parent 7c50da1 commit 42d1506

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/howler.core.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,9 @@
15821582
// Determine the values based on arguments.
15831583
if (args.length === 0) {
15841584
// We will simply return the current position of the first node.
1585-
id = self._sounds[0]._id;
1585+
if (self._sounds.length) {
1586+
id = self._sounds[0]._id;
1587+
}
15861588
} else if (args.length === 1) {
15871589
// First check if this is an ID, and if not, assume it is a new seek position.
15881590
var ids = self._getSoundIds();

0 commit comments

Comments
 (0)