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

toString() of undefined while filtering on the table #151

Closed
cggaurav opened this issue Jun 7, 2013 · 3 comments
Closed

toString() of undefined while filtering on the table #151

cggaurav opened this issue Jun 7, 2013 · 3 comments

Comments

@cggaurav
Copy link

cggaurav commented Jun 7, 2013

.filter('highlight', function() {
return function(text) {
   //previously this
   //if (text.toString().length > 0 && !_.isUndefined(text) && !_.isNull(text)) {
   //now this, to get rid of ~2K + errors on the log!
    if (!_.isUndefined(text) && !_.isNull(text) && text.toString().length > 0) {
      return text.toString().
        replace(/&/g, '&').
        replace(/</g, '&lt;').
        replace(/>/g, '&gt;').
        replace(/\r?\n/g, '<br/>').
        replace(/@start-highlight@/g, '<code class="highlight">').
        replace(/@end-highlight@/g, '</code>')
    }
    return '';
  }
});

@marceldegraaf
Copy link

These errors also occur when overing over a bar in the bar graph:

TypeError: Cannot call method 'toString' of undefined
    at Object.<anonymous> (http://example.com/kibana/panels/table/module.js:272:14)
    at e (http://example.com/kibana/common/lib/angular.min.js:67:353)
    at xa.| (http://example.com/kibana/common/lib/angular.min.js:128:275)
    at Object.get (http://example.com/kibana/common/lib/angular.min.js:66:506)
    at Object.e.$digest (http://example.com/kibana/common/lib/angular.min.js:85:53)
    at Object.e.$apply (http://example.com/kibana/common/lib/angular.min.js:87:198)
    at e (http://example.com/kibana/common/lib/angular.min.js:94:196)
    at p (http://example.com/kibana/common/lib/angular.min.js:97:332)
    at XMLHttpRequest.v.onreadystatechange (http://example.com/kibana/common/lib/angular.min.js:98:252) 

@cggaurav
Copy link
Author

@marceldegraaf This should do the trick.

//previously this
   //if (text.toString().length > 0 && !_.isUndefined(text) && !_.isNull(text)) {
   //now this, to get rid of ~2K + errors on the log!
    if (!_.isUndefined(text) && !_.isNull(text) && text.toString().length > 0) {

marceldegraaf added a commit to marceldegraaf/kibana that referenced this issue Jun 11, 2013
@marceldegraaf
Copy link

See pull request in #157

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

3 participants