Skip to content

Commit

Permalink
Fix getPostData function
Browse files Browse the repository at this point in the history
dataPost can be undefined

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed Jan 8, 2018
1 parent 1fc566f commit 367f49b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5093,9 +5093,8 @@ function configGet(key, cached=true)
jQuery.fn.getPostData = function() {
var dataPost = this.attr('data-post');
// Strip possible leading ?
if (dataPost.startsWith('?')) {
if (dataPost !== undefined && dataPost.startsWith('?')) {
dataPost = dataPost.substr(1);
}
return dataPost;
};

0 comments on commit 367f49b

Please sign in to comment.