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

fix: #389 [macOS] Terminating app due to uncaught exception 'NSIntern… #390

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

potatojoayo
Copy link
Contributor

Issue

#389 [macOS] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'dismissViewController:: Error: maybe this view controller was not presented?'

Cause

webView function in FacebookAuthDesktopPlugin class was calling dismiss(self). It threw the exception that the function was trying to dismissViewController which is not presented (or already closed; maybe it was being called twice).

Solution

Instead of calling dismiss(self), created var window: NSWindow? and set self.view.window of the WebViewController as below.

public override func viewDidAppear() {
        window = self.view.window!
    } 

Then replace dismiss(self) with window?.performClose(nil) in webView function.

…tion 'NSInternalInconsistencyException', reason: 'dismissViewController:: Error: maybe this view controller was not presented?'
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e8d308) 96.77% compared to head (f4e3c13) 96.77%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #390   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files           6        6           
  Lines          93       93           
=======================================
  Hits           90       90           
  Misses          3        3           

@darwin-morocho
Copy link
Owner

@potatojoayo thanks for your PR

@darwin-morocho darwin-morocho merged commit 056b17f into darwin-morocho:master Feb 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants