TypeError can be thrown as "key" might be null or undefined here.SonarQube -


in jquery library jquery-1.4.1-vsdoc.js, following code block :

jquery.fn.extend({ data: function( key, value ) {      if ( typeof key === "undefined" && this.length ) {         return jquery.data( this[0] );      } else if ( typeof key === "object" ) {         return this.each(function() {             jquery.data( this, key );         });     }      var parts = key.split(".");     parts[1] = parts[1] ? "." + parts[1] : ""; 

thought there no problem @ sonarqube gives me critical error:

typeerror can thrown "key" might null or undefined here.

the word key in key.split(".") highlighted. indicating variable key can undefined/null here.

please suggest how resolve issue. sonarqube build number version 6.3 (build 19869)


Comments

Popular posts from this blog

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

javascript - Understanding ExtJS Framework Syntax -