public @Nullable Module commitModule(final @NotNull Project project, final @Nullable ModifiableModuleModel model) {
    if (canCreateModule()) {
      if (myName == null) {
        myName = project.getName();
      }
      if (myModuleFilePath == null) {
        myModuleFilePath = project.getBasePath() + File.separator + myName + ModuleFileType.DOT_DEFAULT_EXTENSION;
      }
      try {
        return ApplicationManager.getApplication().runWriteAction(
          (ThrowableComputable<Module, Exception>)() -> createAndCommitIfNeeded(project, model, true));
      }
      catch (Exception ex) {
        LOG.warn(ex);
        MessagesService.getInstance().showErrorDialog(project, IdeCoreBundle.message("error.adding.module.to.project", ex.getMessage()), IdeCoreBundle.message("title.add.module"));
      }
    }
    return null;
  }
public @Nullable Module commitModule(final @NotNull Project project, final @Nullable ModifiableModuleModel model)