IDEA-152775 Add GA tails to track webhelp redirects from the IDEs: use correct api...
authorAnton Makeev <Anton.Makeev@jetbrains.com>
Mon, 19 Sep 2016 13:08:38 +0000 (15:08 +0200)
committerAnton Makeev <Anton.Makeev@jetbrains.com>
Mon, 19 Sep 2016 13:11:25 +0000 (15:11 +0200)
platform/platform-impl/src/com/intellij/help/impl/HelpManagerImpl.java

index 60510164b2a18317341664b9e1e52408eded40e9..d70cff665beeae2bfad85ef6925cadc5b6fb4ddb 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.openapi.application.ex.ApplicationInfoEx;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.help.HelpManager;
 import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.reference.SoftReference;
 import com.intellij.util.PlatformUtils;
 import org.jetbrains.annotations.NonNls;
@@ -69,12 +70,14 @@ public class HelpManagerImpl extends HelpManager {
         minorVersion = minorVersion.substring(0, dot);
       }
       String productVersion = info.getMajorVersion() + "." + minorVersion;
-      String productCode = info.getPackageCode();
 
       String url = info.getWebHelpUrl() + "/" + productVersion + "/?" + id;
       
       if (PlatformUtils.isJetBrainsProduct()) {
-        url += "&utm_source=from_product&utm_medium=help_link&utm_campaign=" + productCode + "&utm_content=" + productVersion;
+        String productCode = info.getBuild().getProductCode();
+        if(!StringUtil.isEmpty(productCode)) {
+          url += "&utm_source=from_product&utm_medium=help_link&utm_campaign=" + productCode + "&utm_content=" + productVersion;
+        }
       }
 
       BrowserUtil.browse(url);