4 Replies Latest reply: Jun 29, 2010 5:24 AM by bchalupka-syPD9H RSS

    Error after copy and paste

    bchalupka-syPD9H Community Member

      I get this error everytime, if I repeat the following steps:

      1. Type "blabla" into a RichEditableText
      2. Copy "lab"
      3. Insert it after the first "a"
      4. Copy "alabb"
      5. Insert it before the "bb"

       

      I know it's kind of silly, but I tried several other combinations and that one seems to be one that works all the time.

       

      After this procedure the following error appears:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at flashx.textLayout.edit::TextScrap/clone()[C:\Vellum\branches\v1\1.1\dev\output\openSource \textLayout\src\flashx\textLayout\edit\TextScrap.as:239]
      at flashx.textLayout.edit::TextFlowEdit$/replaceRange()[C:\Vellum\branches\v1\1.1\dev\output \openSource\textLayout\src\flashx\textLayout\edit\TextFlowEdit.as:375]
      at flashx.textLayout.operations::PasteOperation/internalDoOperation()[C:\Vellum\branches\v1\ 1.1\dev\output\openSource\textLayout\src\flashx\textLayout\operations\PasteOperation.as:82 ]
      at flashx.textLayout.operations::PasteOperation/doOperation()[C:\Vellum\branches\v1\1.1\dev\ output\openSource\textLayout\src\flashx\textLayout\operations\PasteOperation.as:68]
      at flashx.textLayout.edit::EditManager/doInternal()[C:\Vellum\branches\v1\1.1\dev\output\ope nSource\textLayout\src\flashx\textLayout\edit\EditManager.as:587]
      at flashx.textLayout.edit::EditManager/doOperation()[C:\Vellum\branches\v1\1.1\dev\output\op enSource\textLayout\src\flashx\textLayout\edit\EditManager.as:462]
      at flashx.textLayout.edit::EditManager/pasteTextScrap()[C:\Vellum\branches\v1\1.1\dev\output \openSource\textLayout\src\flashx\textLayout\edit\EditManager.as:1376]
      at flashx.textLayout.edit::EditManager/editHandler()[C:\Vellum\branches\v1\1.1\dev\output\op enSource\textLayout\src\flashx\textLayout\edit\EditManager.as:213]
      at flashx.textLayout.container::ContainerController/editHandler()[C:\Vellum\branches\v1\1.1\ dev\output\openSource\textLayout\src\flashx\textLayout\container\ContainerController.as:23 49]
      at flashx.textLayout.container::TextContainerManager/editHandler()[C:\Vellum\branches\v1\1.1 \dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager.as: 1748]
      at flash.desktop::NativeApplication/performKeyEquivalent()
      at flash.desktop::NativeApplication/_onKeyDownBubble()

       

      Is it a bug in the TLF or a problem with my application?

        • 1. Re: Error after copy and paste
          brent.arndorfer Community Member

          I also happened to catch the stack below in the debugger.  I've seen it a few different times and it may be related.  Looks like it's the op.textScrap that's null in my case.  Not clear on what leads to it.  It actually looks like it may be a bug in RichEditableText in the Flex SDK instead of something in TLF.

           

          Brent

           

          TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at spark.components::RichEditableText/handlePasteOperation()[RichEditableText.as]
              at spark.components::RichEditableText/textContainerManager_flowOperationEndHandler()[RichEdi tableText.as]
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flashx.textLayout.container::TextContainerManager/dispatchEvent()[TextContainerManager.as ]
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flashx.textLayout.elements::TextFlow/dispatchEvent()[TextFlow.as]
              at flashx.textLayout.edit::EditManager/doInternal()[EditManager.as]
              at flashx.textLayout.edit::EditManager/doOperation()[EditManager.as]
              at flashx.textLayout.edit::EditManager/pasteTextScrap()[EditManager.as]
              at flashx.textLayout.edit::EditManager/editHandler()[EditManager.as]
              at flashx.textLayout.container::ContainerController/editHandler()[ContainerController.as]
              at flashx.textLayout.container::TextContainerManager/editHandler()[TextContainerManager.as]

          • 2. Re: Error after copy and paste
            bchalupka-syPD9H Community Member

            Yes. That's possible, but in my case the functions of the RichEditableText are not the source of the problem (as far as I can see). I tried debugging the problem, but it's kind of hard because the error is rethrown by the EditManager (on line 467).

             

            Has anyone an idea on how to fix it? Some customers already discovered it and so it's very important for me that the problem gets fixed.

            • 3. Re: Error after copy and paste
              rdermer Adobe Employee

              If you have a local copy of TLF 1.1 you can work around it by adding a test at line 346 of TextClipboard.as.  Replace

                   endArray.push(curFlElement);

              with

                  if (curFlElement)
                      endArray.push(curFlElement);

               

              That prevents the bug - but the underlying cause needs more investigation.

               

              Richard

              • 4. Re: Error after copy and paste
                bchalupka-syPD9H Community Member

                Thank you, but unfortunately I got no local copy at the moment, but I think about it.