continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r581997 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ProfileAction.java webapp/WEB-INF/jsp/admin/editProfile.jsp
Date Thu, 04 Oct 2007 20:09:32 GMT
Author: olamy
Date: Thu Oct  4 13:09:28 2007
New Revision: 581997

URL: http://svn.apache.org/viewvc?rev=581997&view=rev
Log:
[CONTINUUM-1508] fix NPE with add button in editProfile when installations list is empty

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java?rev=581997&r1=581996&r2=581997&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
Thu Oct  4 13:09:28 2007
@@ -151,9 +151,12 @@
         throws Exception
     {
         Installation installation = installationService.getInstallation( this.getInstallationId()
);
-        profileService.addInstallationInProfile( profile, installation );
-        // read again
-        this.profile = profileService.getProfile( profile.getId() );
+        if ( installation != null )
+        {
+            profileService.addInstallationInProfile( profile, installation );
+            // read again
+            this.profile = profileService.getProfile( profile.getId() );
+        }
         return SUCCESS;
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp?rev=581997&r1=581996&r2=581997&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp
Thu Oct  4 13:09:28 2007
@@ -101,14 +101,19 @@
                     </tr>
                   </tbody>
                 </table>
-                <ww:form action="addInstallationProfile!addInstallation.action" method="get">
-                  <ww:hidden name="profile.id" />
-                  <div class="functnbar3">
-                    <!-- can't use default profile to display this select -->
-                    <ww:select theme="profile" name="installationId" list="allInstallations"
listKey="installationId" listValue="name" />
-                    <ww:submit value="%{getText('add')}"/>
-                  </div>
-                </ww:form>
+                <ww:if test="${!empty allInstallations}">
+                  <ww:form action="addInstallationProfile!addInstallation.action" method="get">
+                    <ww:hidden name="profile.id" />
+                    <div class="functnbar3">
+                      <!-- can't use default profile to display this select -->
+                      <ww:select theme="profile" name="installationId" list="allInstallations"
listKey="installationId" listValue="name" />
+                      <ww:submit value="%{getText('add')}"/>
+                    </div>
+                  </ww:form>
+                </ww:if>
+                <ww:else>
+                  <div class="warningmessage" style="color: red"><ww:text name="profile.no.installations"
/></div>
+                </ww:else>
               </div>              
             </td>
           </tr>



Mime
View raw message