mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FB-125 Filter settings and dialogs: explicitly check if application exists
This commit is contained in:
+5
-5
@@ -1,15 +1,15 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.eventLog
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
|
||||
fun getUiEventLogger(): FeatureUsageUiEvents {
|
||||
return try {
|
||||
ServiceManager.getService(FeatureUsageUiEvents::class.java) ?: EmptyFeatureUsageUiEvents
|
||||
}
|
||||
catch (e : Exception) {
|
||||
EmptyFeatureUsageUiEvents
|
||||
if (ApplicationManager.getApplication() != null) {
|
||||
return ServiceManager.getService(FeatureUsageUiEvents::class.java) ?: EmptyFeatureUsageUiEvents
|
||||
}
|
||||
// cannot load service if application is not initialized
|
||||
return EmptyFeatureUsageUiEvents
|
||||
}
|
||||
|
||||
interface FeatureUsageUiEvents {
|
||||
|
||||
Reference in New Issue
Block a user