Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-5965] Fix analyzer warning in BugsnagClient.m #994

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Bugsnag/Client/BugsnagClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)configuration {
NSDictionary *systemInfo = [BSG_KSSystemInfo systemInfo];
[self.metadata addMetadata:BSGParseAppMetadata(@{@"system": systemInfo}) toSection:BSGKeyApp];
[self.metadata addMetadata:BSGParseDeviceMetadata(@{@"system": systemInfo}) toSection:BSGKeyDevice];
#if BSG_PLATFORM_IOS
_lastOrientation = BSGOrientationNameFromEnum([UIDEVICE currentDevice].orientation);
[self.state addMetadata:_lastOrientation withKey:BSGKeyOrientation toSection:BSGKeyDeviceState];
#endif
// sync initial state
[self metadataChanged:self.metadata];
[self metadataChanged:self.state];
Expand All @@ -300,10 +304,6 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)configuration {
self.pluginClient = [[BugsnagPluginClient alloc] initWithPlugins:self.configuration.plugins
client:self];

#if BSG_PLATFORM_IOS
_lastOrientation = BSGOrientationNameFromEnum([UIDEVICE currentDevice].orientation);
#endif

if (self.user.id == nil) { // populate with an autogenerated ID if no value set
[self setUser:[BSG_KSSystemInfo deviceAndAppHash] withEmail:configuration.user.email andName:configuration.user.name];
}
Expand Down Expand Up @@ -380,7 +380,6 @@ - (void)start {
[[UIDEVICE currentDevice] beginGeneratingDeviceOrientationNotifications];

[self batteryChanged:nil];
[self orientationChanged:nil];
[self addTerminationObserver:UIApplicationWillTerminateNotification];

#elif BSG_PLATFORM_OSX
Expand Down