- Ensure Redmine url is properly formatted (issue 223)\r
- Use standard ServletRequestWrapper instead of custom wrapper (issue 224)\r
- Switch commit message back to a pre and ensure that it is properly escaped when combined with commit message regex substitution (issue 242)\r
+ - Improve NPE handling for hook script enumeration (issue-253)\r
\r
changes:\r
- Improved error logging for servlet containers which provide a null contextFolder (issue 199)\r
if (repository != null) {
for (String teamname : userService.getTeamnamesForRepositoryRole(repository.name)) {
TeamModel team = userService.getTeamModel(teamname);
- scripts.addAll(team.preReceiveScripts);
+ if (!ArrayUtils.isEmpty(team.preReceiveScripts)) {
+ scripts.addAll(team.preReceiveScripts);
+ }
}
}
return new ArrayList<String>(scripts);
if (repository != null) {
for (String teamname : userService.getTeamnamesForRepositoryRole(repository.name)) {
TeamModel team = userService.getTeamModel(teamname);
- scripts.addAll(team.postReceiveScripts);
+ if (!ArrayUtils.isEmpty(team.postReceiveScripts)) {
+ scripts.addAll(team.postReceiveScripts);
+ }
}
}
return new ArrayList<String>(scripts);
import com.gitblit.client.Translation;\r
import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.UserModel;\r
+import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.ClientLogger;\r
import com.gitblit.utils.JGitUtils;\r
import com.gitblit.utils.PushLogUtils;\r
\r
Set<String> scripts = new LinkedHashSet<String>();\r
scripts.addAll(GitBlit.self().getPreReceiveScriptsInherited(repository));\r
- scripts.addAll(repository.preReceiveScripts);\r
+ if (!ArrayUtils.isEmpty(repository.preReceiveScripts)) {\r
+ scripts.addAll(repository.preReceiveScripts);\r
+ }\r
runGroovy(repository, user, commands, rp, scripts);\r
for (ReceiveCommand cmd : commands) {\r
if (!Result.NOT_ATTEMPTED.equals(cmd.getResult())) {\r
// run Groovy hook scripts \r
Set<String> scripts = new LinkedHashSet<String>();\r
scripts.addAll(GitBlit.self().getPostReceiveScriptsInherited(repository));\r
- scripts.addAll(repository.postReceiveScripts);\r
+ if (!ArrayUtils.isEmpty(repository.postReceiveScripts)) {\r
+ scripts.addAll(repository.postReceiveScripts);\r
+ }\r
runGroovy(repository, user, commands, rp, scripts);\r
}\r
\r