Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-40896

Deleting custom image for project avatar will cause NPE for Edit Project

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Deleting custom image for project avatar will cause NPE for Edit Project.

      java.lang.NullPointerException
      	at com.atlassian.jira.web.action.project.EditProject.doDefault(EditProject.java:67)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
      	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
      

      Steps to reproduce:

      1. Create a project
      2. Click on Edit for the project from projects list in administration - https://<domain>/secure/project/ViewProjects.jspa
      3. Click select image - upload a custom image for avatar and update/save
      4. Edit the project again by clicking Edit in project list and select image
      5. Delete the custom image by hovering the cursor on it and click X at the top right of the image. Close the select image dialogue
      6. Click Update
      7. The project avatar now is changed to Atlassian's Charlie instead of default rocket or broken image in project's administration page. Editing the project will throw NPE error

      Expected behavior
      The project's avatar should be set to default one(rocket icon).

      Workaround
      The project's avatar ID need to be updated from database and restart JIRA. For Atlassian OnDemand users, please create a support ticket at https://support.atlassian.com under OnDemand Support project to get this fixed.

            [JRASERVER-40896] Deleting custom image for project avatar will cause NPE for Edit Project

            Another workaround if you have Script Runner can directly change the project without having to restart.

            Thanks a lot for this hint! Saved us a restart. Short additional note: The script contains a tiny typo in 6th row (curpoj.getUrl => curproj.getUrl), so the correct script is:

            import com.atlassian.jira.project.Project;
            import com.atlassian.jira.project.ProjectManager;
            import com.atlassian.jira.component.ComponentAccessor;
            
            Project curproj = ComponentAccessor.getProjectManager().getProjectObjByKey("<Your project key here>");
            ComponentAccessor.getProjectManager().updateProject(curproj,curproj.getName(),curproj.getDescription(),curproj.getLeadUserName(),curproj.getUrl(),curproj.getAssigneeType(),10001l)
            

            Kai Gottschalk added a comment - Another workaround if you have Script Runner can directly change the project without having to restart. Thanks a lot for this hint! Saved us a restart. Short additional note: The script contains a tiny typo in 6th row (curpoj.getUrl => curproj.getUrl), so the correct script is: import com.atlassian.jira.project.Project; import com.atlassian.jira.project.ProjectManager; import com.atlassian.jira.component.ComponentAccessor; Project curproj = ComponentAccessor.getProjectManager().getProjectObjByKey( "<Your project key here>" ); ComponentAccessor.getProjectManager().updateProject(curproj,curproj.getName(),curproj.getDescription(),curproj.getLeadUserName(),curproj.getUrl(),curproj.getAssigneeType(),10001l)

            Another workaround if you have Script Runner can directly change the project without having to restart.

            import com.atlassian.jira.project.Project;
            import com.atlassian.jira.project.ProjectManager;
            import com.atlassian.jira.component.ComponentAccessor;
            
            Project curproj = ComponentAccessor.getProjectManager().getProjectObjByKey("<Your project key here>");
            ComponentAccessor.getProjectManager().updateProject(curproj,curproj.getName(),curproj.getDescription(),curproj.getLeadUserName(),curpoj.getUrl(),curproj.getAssigneeType(),10001l)
            

            Nicholas Slow added a comment - Another workaround if you have Script Runner can directly change the project without having to restart. import com.atlassian.jira.project.Project; import com.atlassian.jira.project.ProjectManager; import com.atlassian.jira.component.ComponentAccessor; Project curproj = ComponentAccessor.getProjectManager().getProjectObjByKey( "<Your project key here>" ); ComponentAccessor.getProjectManager().updateProject(curproj,curproj.getName(),curproj.getDescription(),curproj.getLeadUserName(),curpoj.getUrl(),curproj.getAssigneeType(),10001l)

            Issues in such projects cannot be browsed, either. An NPE is the result of trying to open them. See attached file.

            Patric Schenke added a comment - Issues in such projects cannot be browsed, either. An NPE is the result of trying to open them. See attached file.

              mzeng@atlassian.com Michelle Zeng
              mfahd Fahd
              Affected customers:
              2 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: