Check the null value of UserAgent

This commit is contained in:
hikaruworld
2014-08-13 17:16:34 +09:00
committed by ymorika
parent 7b37d6b571
commit 08eb21844a
2 changed files with 3 additions and 1 deletions

View File

@@ -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
}
/**

View File

@@ -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>