Fix warning when no entrypoing args provided. (flutter/engine#22136)

Fixes errors like:
GLib-CRITICAL **: 14:20:17.248: g_strv_length: assertion 'str_array != NULL' failed

Introduced in fe489569a722816acab038ebe0f882722d2434ee
This commit is contained in:
Robert Ancell 2020-10-30 14:57:35 +13:00 committed by GitHub
parent 904e5d491e
commit 524a96de10

View File

@ -395,7 +395,8 @@ gboolean fl_engine_start(FlEngine* self, GError** error) {
args.platform_message_callback = fl_engine_platform_message_cb;
args.custom_task_runners = &custom_task_runners;
args.shutdown_dart_vm_when_done = true;
args.dart_entrypoint_argc = g_strv_length(dart_entrypoint_args);
args.dart_entrypoint_argc =
dart_entrypoint_args != nullptr ? g_strv_length(dart_entrypoint_args) : 0;
args.dart_entrypoint_argv =
reinterpret_cast<const char* const*>(dart_entrypoint_args);