Skip to content

Commit 9bfd635

Browse files
authored
Merge pull request readthedocs#5285 from rtfd/fix-old-jquery
Support old jquery where responseJSON doesn't exist
2 parents c762a61 + 816d1b8 commit 9bfd635

File tree

1 file changed

+5
-1
lines changed
  • readthedocs/core/static-src/core/js/doc-embed

1 file changed

+5
-1
lines changed

readthedocs/core/static-src/core/js/doc-embed/search.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ function attach_elastic_search_query(data) {
103103
withCredentials: true,
104104
},
105105
complete: function (resp, status_code) {
106-
if (status_code !== 'success' || resp.responseJSON.count === 0) {
106+
if (
107+
status_code !== 'success' ||
108+
typeof (resp.responseJSON) === 'undefined' ||
109+
resp.responseJSON.count === 0
110+
) {
107111
return search_def.reject();
108112
}
109113
return search_def.resolve(resp.responseJSON);

0 commit comments

Comments
 (0)