Add condition to verify data in pointsbar.js is not undefined