Skip to content

Commit

Permalink
fix swift linting
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhaintz committed Oct 11, 2024
1 parent bb9e2c4 commit 2cc98f6
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,28 +278,31 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}

private func loadImageList(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
var debugImages: [DebugMeta] = []

if let arguments = call.arguments as? Array<String> , !arguments.isEmpty{
var imagesAddresses: Set<String> = []

for argument in arguments {
let hexDigits = argument.replacingOccurrences(of: "0x", with: "")
if let instructionAddress = UInt64(hexDigits, radix: 16) {
let image = SentryDependencyContainer.sharedInstance().binaryImageCache.image(byAddress: instructionAddress)
if let image = image {
let imageAddress = sentry_formatHexAddressUInt64(image.address)!
imagesAddresses.insert(imageAddress)
}
}
}
debugImages = SentryDependencyContainer.sharedInstance().debugImageProvider.getDebugImages(forAddresses: imagesAddresses, isCrash: false) as [DebugMeta]
}
if (debugImages.isEmpty) {
debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
}

result(debugImages.map { $0.serialize() })
var debugImages: [DebugMeta] = []

if let arguments = call.arguments as? [String], !arguments.isEmpty {
var imagesAddresses: Set<String> = []

for argument in arguments {
let hexDigits = argument.replacingOccurrences(of: "0x", with: "")
if let instructionAddress = UInt64(hexDigits, radix: 16) {
let image = SentryDependencyContainer.sharedInstance().binaryImageCache.image(
byAddress: instructionAddress)
if let image = image {
let imageAddress = sentry_formatHexAddressUInt64(image.address)!
imagesAddresses.insert(imageAddress)
}
}
}
debugImages =
SentryDependencyContainer.sharedInstance().debugImageProvider.getDebugImages(
forAddresses: imagesAddresses, isCrash: false) as [DebugMeta]
}
if debugImages.isEmpty {
debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
}

result(debugImages.map { $0.serialize() })
}

private func initNativeSdk(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
Expand Down

0 comments on commit 2cc98f6

Please sign in to comment.