Skip to content

Commit

Permalink
fixed crashing issue due to null refreshview outlet
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Feb 24, 2023
1 parent e759138 commit d393198
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
8 changes: 5 additions & 3 deletions XCreds/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ class WebViewController: NSWindowController {
return NSNib.Name("WebView")
}

@IBOutlet weak var refreshTitleTextField: NSTextField!
@IBOutlet weak var backgroundImageView: NSImageView!
@IBOutlet weak var refreshTitleTextField: NSTextField?
@IBOutlet weak var webView: WKWebView!
@IBOutlet weak var cancelButton: NSButton!

var password:String?
func loadPage() {

refreshTitleTextField.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowRefreshBanner.rawValue)

if let refreshTitleTextField = refreshTitleTextField {
refreshTitleTextField.isHidden = !UserDefaults.standard.bool(forKey: PrefKeys.shouldShowRefreshBanner.rawValue)
}

webView.navigationDelegate = self
TokenManager.shared.oidc().delegate = self
Expand Down
2 changes: 2 additions & 0 deletions XCredsLoginPlugIn/LoginWindow/LoginWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class LoginWebViewController: WebViewController {
var delegate: XCredsMechanismProtocol?
var resolutionObserver:Any?
var loginProgressWindowController:LoginProgressWindowController?
@IBOutlet weak var backgroundImageView: NSImageView!

override func windowDidLoad() {
super.windowDidLoad()

Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -940,7 +940,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1001,7 +1001,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1033,7 +1033,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1178,7 +1178,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -1209,7 +1209,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3440;
CURRENT_PROJECT_VERSION = 3447;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,5 @@
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C00BF00C-4ABB-429D-A3A8-FBB5F21C90CE"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "XCreds/WebView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "29"
endingLineNumber = "29"
landmarkName = "loadPage()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

0 comments on commit d393198

Please sign in to comment.