Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'replace' of null at HowlerGlobal.codecs #680

Closed
adnanibric opened this issue Dec 27, 2016 · 1 comment

Comments

@adnanibric
Copy link

adnanibric commented Dec 27, 2016

Hi,

We have used howler v1.1.25 and when migrating to v2.02 we get this issue and script broke.

Older version load method did not call:

// Check if this extension is available.
        if (Howler.codecs(ext)) {
          url = self._src[i];
          break;
        }

and everything is working fine.

New script is calling Howler.codecs with extension and if in some case invalid file without any extension is passed to script javascript will stop executing. I think script should not break javascript it should be more robust and I suggest inserting check if extension exists:

/**
     * Check for codec support of specific extension.
     * @param  {String} ext Audio file extention.
     * @return {Boolean}
     */
    codecs: function(ext) {
      if (ext) {
          return (this || Howler)._codecs[ext.replace(/^x-/, '')];
      }
      
    },

Please let me know what do you think about this?

Thanks,
Adnan

@Chrischuck
Copy link

I'm getting this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants