提交 54706afb 编写于 作者: C Chinmay Garde 提交者: GitHub

Avoid using [NSArray firstObject] on the Mac platform view. (#2993)

上级 e281b602
......@@ -4,6 +4,7 @@
#include "flutter/sky/shell/platform/mac/platform_view_mac.h"
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "base/command_line.h"
......@@ -31,8 +32,10 @@ PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view)
weak_factory_(this) {
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
sky::shell::Shell::Shared().tracing_controller().set_traces_base_path(
[paths.firstObject UTF8String]);
if (paths.count > 0) {
sky::shell::Shell::Shared().tracing_controller().set_traces_base_path(
[[paths objectAtIndex:0] UTF8String]);
}
}
PlatformViewMac::~PlatformViewMac() = default;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册