 			child.revert()
 
 		# shared items
-		if itemDocumentNode._documentStyle is @
+		if itemDocumentNode?._documentStyle is @
 			# revert linkUri
 			if @isLinkUriSet
 				@item.linkUri = @baseLinkUri

				if val of ATTR_PRIMITIVE_VALUES
					val = ATTR_PRIMITIVE_VALUES[val]

				if val?
					switch typeof obj[prop]
						when 'number'
							val = parseFloat val
						when 'boolean'
							val = !!val
						when 'string'
							val = val+''

				if typeof obj[prop] is 'function'
					unless typeof val is 'function'
						log.error "#{name} is a signal handler and expects function, but #{val} got"
						continue
					obj[prop] val
					@attrListeners.push obj, prop, val
				else
					unless @setAttrs[name]
						@setAttrs[name] = true
						@attrValues.push obj, prop, obj[prop]


					# find index
					tmpIndexNode = node
					item = item._sourceItem or item
					while tmpIndexNode
						if tmpIndexNode._nextSibling?._documentStyle?.item?.parent is item
							@item.index = tmpIndexNode._nextSibling._documentStyle.item.index
							break
						tmpIndexNode = tmpIndexNode._parent

