summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-03-15 21:52:11 +0000
committerGitHub <noreply@github.com>2021-03-15 17:52:11 -0400
commit6e423d5573c20b78d6e21cb044e8f4d5de5b288a (patch)
tree61d2e282bc652b8254271fdd9e19b87a386b5dc7 /models/user.go
parentf268b4896b1030761b28f1f8923d77d87adb8f0b (diff)
downloadgitea-6e423d5573c20b78d6e21cb044e8f4d5de5b288a.tar.gz
gitea-6e423d5573c20b78d6e21cb044e8f4d5de5b288a.zip
Ensure validation occurs on clone addresses too (#14994)
* Ensure validation occurs on clone addresses too Fix #14984 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix api tests Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 51c1bb0ce1..098f6af2b3 100644
--- a/models/user.go
+++ b/models/user.go
@@ -296,7 +296,7 @@ func (u *User) CanEditGitHook() bool {
// CanImportLocal returns true if user can migrate repository by local path.
func (u *User) CanImportLocal() bool {
- if !setting.ImportLocalPaths {
+ if !setting.ImportLocalPaths || u == nil {
return false
}
return u.IsAdmin || u.AllowImportLocal