IsEditable should also handle the situation when no project idea exists, i. e. when the model is null.

This commit is contained in:
Tom Vahlman 2012-02-08 12:11:21 +01:00
parent 386292066d
commit 674ab0dcf1

@ -81,12 +81,13 @@ public class ProjectIdeaSubmissionPanel extends Panel {
* Identifier for the panel.
* @param user
* The current sessions user, the one that wants to submit a project idea.
* @param idea
* The project idea, that is submitted
*/
public ProjectIdeaSubmissionPanel(String id, User user, ProjectIdea idea) {
super(id);
add(new FeedbackPanel("feedback"));
add(new ProjectIdeaForm("projectIdeaForm", user, new Model<ProjectIdea>(idea)));
dialogSetup();
}
@ -509,7 +510,7 @@ public class ProjectIdeaSubmissionPanel extends Panel {
* @return boolean
*/
private boolean isEditable() {
return facade.openApplicationPeriodsExists(ideaModel.getObject().getProjectClass()) && isCreator();
return (ideaModel.getObject() == null || facade.openApplicationPeriodsExists(ideaModel.getObject().getProjectClass()) && isCreator());
}
/**