Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
fix: fail safe when portlet lacks title
Browse files Browse the repository at this point in the history
In case where portlet.title undefined
don't consider that portlet a filter match on title
but don't exception out the whole filtering attempt
  • Loading branch information
apetro committed Mar 21, 2018
1 parent b3d4a57 commit a960883
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/main/webapp/my-app/marketplace/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ define(['angular', 'jquery'], function(angular, $) {
var lowerSearchTerm = searchTerm.toLowerCase();

// check title
if (portlet.title.toLowerCase().indexOf(lowerSearchTerm) !== -1) {
if (portlet
&& portlet.title
&& portlet.title.toLowerCase().indexOf(lowerSearchTerm) !== -1) {
return true;
}

Expand Down

0 comments on commit a960883

Please sign in to comment.