Skip to content

Commit

Permalink
fix: ensure data object allways passed when generating html for slot
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Sep 27, 2022
1 parent 443d818 commit a851aa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LassoPageResult.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var extend = require('raptor-util/extend');
var toString = require('./util/to-string');
const LassoPrebuild = require('./LassoPrebuild');
var EMPTY_OBJECT = {};

function LassoPageResult (options = {}) {
const { htmlBySlot, resources } = options;
Expand Down Expand Up @@ -93,7 +94,7 @@ LassoPageResult.prototype = {
* @return {String} The HTML for the slot or an empty string if there is no HTML defined for the slot.
*/
getHtmlForSlot: function(slotName, data) {
return toString(this._htmlBySlot[slotName], data);
return toString(this._htmlBySlot[slotName], data || EMPTY_OBJECT);
},

getHeadHtml: function(data) {
Expand Down

0 comments on commit a851aa6

Please sign in to comment.