   resizeAttachmentToDimensions: (attachment, {width, height} = {}) ->
     if range = @getRangeOfAttachment(attachment)
       @addAttributesAtRange({width, height}, range)
+    else
+      this
 
   getLength: ->
     @pieceList.getLength()

  inspect: ->
    @pieceList.inspect()

  copy: ->
    new @constructor @pieceList.toArray()

  toString: ->
    @pieceList.toString()


    @pieceList.getPieceListInRange(range)?.getCommonAttributes() ? {}

  getTextAtRange: (range) ->
    @copyWithPieceList @pieceList.getPieceListInRange(range)

  getStringAtRange: (range) ->
    @pieceList.getPieceListInRange(range).toString()
