Skip to content

Commit

Permalink
Check that Turbolinks is not undefined before checking support
Browse files Browse the repository at this point in the history
When Turbolinks is not being used, the variable will be undefined and you will get a `ReferenceError: Turbolinks is not defined`.
  • Loading branch information
mattcg authored and mejackreed committed Oct 7, 2016
1 parent 2461525 commit 786743b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/blacklight/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Blacklight = function() {

listeners: function () {
var listeners = [];
if (Turbolinks && Turbolinks.supported) {
if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
// Turbolinks 5
if (Turbolinks.BrowserAdapter) {
listeners.push('turbolinks:load');
Expand Down

0 comments on commit 786743b

Please sign in to comment.