Bug 701762 - DOMTemplate fails when returns undefined; r=dcamp

This commit is contained in:
Joe Walker 2011-11-19 08:34:05 -08:00
parent f6801cc272
commit 35d0ef028d

View File

@ -343,7 +343,7 @@ Templater.prototype._toNode = function(thing, document) {
* then _handleAsync() is just 'inserter(thing, siblingNode)'
*/
Templater.prototype._handleAsync = function(thing, siblingNode, inserter) {
if (typeof thing.then === 'function') {
if (thing != null && typeof thing.then === 'function') {
// Placeholder element to be replaced once we have the real data
var tempNode = siblingNode.ownerDocument.createElement('span');
siblingNode.parentNode.insertBefore(tempNode, siblingNode);