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

Commit

Permalink
Dictionary: Move filter() in dictionary below the guard (#3335)
Browse files Browse the repository at this point in the history
* move filter() in dictionary below the guard

* move filter back above the guard, just add guards for the fitler
  • Loading branch information
bsstoner authored and moollaza committed Jun 20, 2017
1 parent dace790 commit bd12619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion share/spice/dictionary/definition/dictionary_definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var ddg_spice_dictionary = {
definition: function(api_result) {
"use strict";

api_result = api_result.filter(function(result) { return result.text; })
api_result = api_result && api_result.length && api_result.filter(function(result) { return result.text; })
if (!api_result || !api_result.length) { return Spice.failed('dictionary_definition'); }

// Prevent jQuery from appending "_={timestamp}" in our url when we use $.getScript.
Expand Down

0 comments on commit bd12619

Please sign in to comment.