 
         # remove the firstAddedLine from the fragment
         firstAddedLine = dummyLine.lineNext
-        secondAddedLine = firstAddedLine.lineNext
-        frag.removeChild(frag.firstChild)
-        delete this._lines[firstAddedLine.lineID]
+        secondAddedLine = firstAddedLine?.lineNext
+        if frag.firstChild?
+            frag.removeChild(frag.firstChild)
+        if firstAddedLine?
+            delete this._lines[firstAddedLine.lineID]
 
         # 7- updates nextLine and prevLines, insert frag in the editor
         if secondAddedLine?

        # 2- Case of a selection contained in a line
        else if sel.endLine == startLine
            console.log '_backspace 6 - test ok2'
            sel.range.deleteContents()
            # e.preventDefault()

        # 3- Case of a multi lines selection
        else
            console.log '_backspace 7'
            @_deleteMultiLinesSelections()
            # e.preventDefault()

        e.preventDefault()
        return false



                    txtNode = document.createTextNode(child.textContent)
                    
                    if context.currentLineEl.nodeName in ['SPAN','A']
                        context.currentLineEl.appendChild txtNode
                    else
                        spanEl = document.createElement('span')
                        spanEl.appendChild txtNode
                        context.currentLineEl.appendChild spanEl
                    
                    # @_appendCurrentLineFrag(context,absDepth,absDepth)
                    context.isCurrentLineBeingPopulated = true
