Handle undefined text area values

Check to see if a text area's `val` is defined before trying to call
`replace()` on it.
This commit is contained in:
Vinnie Okada
2014-08-22 10:40:25 -05:00
parent 230c52f76a
commit 8ed7391cb0
+1 -1
View File
@@ -54,7 +54,7 @@ window.extractLast = (term) ->
return split( term ).pop()
window.rstrip = (val) ->
return val.replace(/\s+$/, '')
return if val then val.replace(/\s+$/, '') else val
# Disable button if text field is empty
window.disableButtonIfEmptyField = (field_selector, button_selector) ->