FLEXTool / FLEX

An in-app debugging and exploration tool for iOS
Other
14.03k stars 1.7k forks source link

Fix EXC_BAD_ACCESS in FLEXNetworkObserver #660

Closed ahmedgomaa27 closed 1 year ago

ahmedgomaa27 commented 1 year ago

the crash happened after I used FLEX and Firestore in my app, the root cause for it is trying to set error in Orig block and the error value is nil so we need to check on it first

Screen Shot 2023-03-08 at 2 02 53 PM
NSExceptional commented 1 year ago

Passing nil to a function doesn't cause that error. I think orig may be nil or corrupted instead

ahmedgomaa27 commented 1 year ago

@NSExceptional when i run XCode debugging , i found that error = nil

NSExceptional commented 1 year ago

Yes but that won't cause a crash, error is supposed to be nil unless there is an error

ryanolsonk commented 1 year ago

I've seen this one. The completion is optional so orig can (validly) be nil. We should just guard against trying to call it when that is the case.

ahmedgomaa27 commented 1 year ago

@NSExceptional @ryanolsonk I updated the code now please check

ryanolsonk commented 1 year ago

Looks good to me, @NSExceptional ?

NSExceptional commented 1 year ago

Thanks!!

ahmedgomaa27 commented 1 year ago

@NSExceptional will be a new version for this fix? as i need to upgrade current version