In JQuery Library jquery-1.4.1-vsdoc.js, Following is the 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 is no problem at all but SonarQube gives me a critical error:
TypeError can be thrown as "key" might be null or undefined here.
The word key in key.split(".") is highlighted. Indicating variable key can be undefined/null here.
Please suggest how to resolve this issue. SonarQube Build Number is Version 6.3 (build 19869)