Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-822

NPE thrown by PluginContext#getText()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.10
    • 2.10.1
    • Plugins
    • None
    • Ubuntu Linux 12.10, JDK 7 (but bug is independent of environment)

    Description

      In previous versions of JSPWiki there was a null check in PluginContent#getText() to make sure that

      WikiContext context = doc.getContext();

      actually returns a WikiContext. In certain cases (e.g., WikiForms) the context can get lost, so that the subsequent call on line 150

      Boolean wysiwygVariable = (Boolean) context.getVariable(RenderingManager.WYSIWYG_EDITOR_MODE);

      throws an NPE. I would recommend reinstating the earlier check from JSPWiki 2.9.x:

      if( context == null )
      return "No WikiContext available: INTERNAL ERROR";

      or perhaps an improvement. As is, the NPE results (from the user's perspective) in empty wiki page.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ichiro.furusato Ichiro Furusato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified