Skip to content

Cannot read property 'apply' of null #1475

@daN4cat

Description

@daN4cat

After upgrading from 1.10.0 to 1.11.0 the following code causes an error:

  // set data-selected on options that are programmatically selected
  // prior to initialization of bootstrap-select
  var _val = $.fn.val;
  $.fn.val = function(value){
    if (this.is('select') && value) {
      this.find('option[value="' + value + '"]').data('selected', true);
    }

    return _val.apply(this, arguments);
  };

the exception is thrown on the return line. It looks like _val is null.

What changed from 1.10.0 to 1.11.0 that could cause this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions