Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-2062

Missing NPE check in IndexOperation#getDocument()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.1.1
    • 5.1.2
    • None

    Description

      In entry deletion, invocation of IndexManagerImpl#addEntryReIndexOperation() occurs and it assumes WeblogEntry.pubTime is present but it's null if it is a unpublished entry.

      I think there's no impact for regular use but it seems like not intended behavior so I think adding simple null check is reasonable.

      Step to reproduce:

      1. Save a new entry as draft
      2. Delete the draft

      Exception:

      ERROR 2015-02-08 09:39:10,152 WriteToIndexOperation:run - Error acquiring write lock on index
      java.lang.NullPointerException
      at org.apache.roller.weblogger.business.search.operations.IndexOperation.getDocument(IndexOperation.java:138)
      at org.apache.roller.weblogger.business.search.operations.ReIndexEntryOperation.doRun(ReIndexEntryOperation.java:91)
      at org.apache.roller.weblogger.business.search.operations.WriteToIndexOperation.run(WriteToIndexOperation.java:42)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

      UPDATE:

      I found an another problematic situation. following procedure brings NPE at the same point:

      1. Publish a entry
      2. Save same entry which is published as a draft (back to draft)
      3. Publish the entry again

      It has possibility of making some un-indexed content so it should be fixed.

      Attachments

        1. ROL-2062.patch
          0.9 kB
          Kohei Nozaki

        Activity

          People

            djohnson David Johnson
            xkylex Kohei Nozaki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: