Skip to content
This repository has been archived by the owner on Dec 24, 2017. It is now read-only.

Commit

Permalink
Implemented more robust 'is a string' tests, to avoid situations wher…
Browse files Browse the repository at this point in the history
…e passing an empty selector to jQuery 1.3.2 throws and exception.
  • Loading branch information
Stephen Lewis committed May 20, 2009
1 parent 2ca4121 commit d64f12f
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -155,7 +155,7 @@ if (typeof(SJL.SLGoogleMap) == 'undefined' || ( ! SJL.SLGoogleMap instanceof Obj
}

// If we have a "map_field", we need to update it every time our map changes.
if (typeof(init.map_field) != 'undefined') {
if (typeof(init.map_field) == 'string' && init.map_field.length) {
this.__map_field = jQuery('#' + init.map_field);

// Add the event listener.
Expand All @@ -171,7 +171,7 @@ if (typeof(SJL.SLGoogleMap) == 'undefined' || ( ! SJL.SLGoogleMap instanceof Obj

// If we have an "address_input" field, and an "address_submit" field, we need to
// link these to our map.
if (typeof(init.address_input) != 'undefined' && typeof(init.address_submit) != 'undefined') {
if (typeof(init.address_input) == 'string' && typeof(init.address_submit) == 'string' && init.address_input.length && init.address_submit.length) {
this.__address_input = jQuery('#' + init.address_input);
this.__address_submit = jQuery('#' + init.address_submit);

Expand Down

0 comments on commit d64f12f

Please sign in to comment.