Skip to content

Commit e9b6241

Browse files
authored
Merge pull request #1423 from rigobauer/fix/seek-not-checking-sound-is-loaded
fix: check that sounds are loaded in seek (returning current position)
2 parents d165bfd + 42d1506 commit e9b6241

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
@@ -1584,7 +1584,9 @@
15841584
// Determine the values based on arguments.
15851585
if (args.length === 0) {
15861586
// We will simply return the current position of the first node.
1587-
id = self._sounds[0]._id;
1587+
if (self._sounds.length) {
1588+
id = self._sounds[0]._id;
1589+
}
15881590
} else if (args.length === 1) {
15891591
// First check if this is an ID, and if not, assume it is a new seek position.
15901592
var ids = self._getSoundIds();

0 commit comments

Comments
 (0)