Index: /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
===================================================================
--- /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java	(revision 405803)
+++ /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java	(working copy)
@@ -140,11 +140,14 @@
         addAll(((InlineLevelLayoutManager)
                      prevBox.getLayoutManager())
                     .addALetterSpaceTo(oldList));
-        if (((KnuthInlineBox) prevBox).isAnchor()) {
-            // prevBox represents a footnote citation: copy footnote info
-            // from prevBox to the new box
-            KnuthInlineBox newBox = (KnuthInlineBox) getLast();
-            newBox.setFootnoteBodyLM(((KnuthInlineBox) prevBox).getFootnoteBodyLM());
+        if (prevBox instanceof KnuthInlineBox) {
+            if (((KnuthInlineBox) prevBox).isAnchor()) {
+                // prevBox represents a footnote citation: copy footnote info
+                // from prevBox to the new box
+                KnuthInlineBox newBox = (KnuthInlineBox) getLast();
+                newBox.setFootnoteBodyLM(((KnuthInlineBox) prevBox)
+                        .getFootnoteBodyLM());
+            }
         }
     }
 
Index: /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
===================================================================
--- /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java	(revision 405803)
+++ /Users/mage/Documents/JavaLib/xml-fop/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java	(working copy)
@@ -292,14 +292,18 @@
             element.setPosition(((NonLeafPosition)element.getPosition()).getPosition());
         }
 
-        oldList = ((InlineLevelLayoutManager)
-                   element.getLayoutManager()).addALetterSpaceTo(oldList);
+        InlineLevelLayoutManager inlineLayoutMgr = ((InlineLevelLayoutManager) element
+                .getLayoutManager());
+        if (inlineLayoutMgr != null) {
+            oldList = inlineLayoutMgr.addALetterSpaceTo(oldList);
 
-        // "wrap" again the Position stored in each element of oldList
-        oldListIterator = oldList.listIterator();
-        while (oldListIterator.hasNext()) {
-            element = (KnuthElement) oldListIterator.next();
-            element.setPosition(notifyPos(new NonLeafPosition(this, element.getPosition())));
+            // "wrap" again the Position stored in each element of oldList
+            oldListIterator = oldList.listIterator();
+            while (oldListIterator.hasNext()) {
+                element = (KnuthElement) oldListIterator.next();
+                element.setPosition(notifyPos(new NonLeafPosition(this, element
+                        .getPosition())));
+            }
         }
 
         return oldList;
