File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,7 +436,11 @@ void SetLogCallback(const LogCallback& callback) {
436436 std::lock_guard<std::mutex> lock (g_log_callback_mutex);
437437 g_log_callback = callback;
438438 }
439- GoogleAnalytics_SetLogCallback (GoogleAnalyticsWrapperLogCallback);
439+ if (callback) {
440+ GoogleAnalytics_SetLogCallback (GoogleAnalyticsWrapperLogCallback);
441+ } else {
442+ GoogleAnalytics_SetLogCallback (nullptr );
443+ }
440444}
441445
442446// Notify the Analytics SDK about the current state of the app's lifecycle.
Original file line number Diff line number Diff line change @@ -155,9 +155,10 @@ class Analytics {
155155 google_analytics_options->analytics_collection_enabled_at_first_launch =
156156 options.analytics_collection_enabled_at_first_launch ;
157157 google_analytics_options->app_data_directory =
158- options.app_data_directory .value_or (" " ).empty ()
159- ? nullptr
160- : options.app_data_directory .value ().c_str ();
158+ (options.app_data_directory .has_value () &&
159+ !options.app_data_directory ->empty ())
160+ ? options.app_data_directory ->c_str ()
161+ : nullptr ;
161162 return GoogleAnalytics_Initialize (google_analytics_options);
162163 }
163164
You can’t perform that action at this time.
0 commit comments