mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 15:35:59 +01:00
Check the null value of UserAgent
This commit is contained in:
@@ -146,9 +146,11 @@ case class Context(settings: SystemSettingsService.SystemSettings, loginAccount:
|
||||
val baseUrl = settings.baseUrl(request)
|
||||
val host = new java.net.URL(baseUrl).getHost
|
||||
val platform = request.getHeader("User-Agent") match {
|
||||
case null => null
|
||||
case agent if agent.contains("Mac") => "mac"
|
||||
case agent if agent.contains("Linux") => "linux"
|
||||
case agent if agent.contains("Win") => "windows"
|
||||
case _ => null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
}
|
||||
@id.map { id =>
|
||||
@if(context.platform != "linux"){
|
||||
@if(context.platform != "linux" || context.platform != null){
|
||||
<div style="margin-top: 10px;">
|
||||
<a href="@repository.httpOpenRepoUrl(context.platform)" id="repository-clone-url" class="btn btn-small" style="width: 147px;"><i class="icon-download-alt"></i>Clone in Desktop</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user