Skip to content

Commit

Permalink
Fix supportPage optional
Browse files Browse the repository at this point in the history
  • Loading branch information
cocojoe committed Apr 6, 2017
1 parent 00334d5 commit 7b8b70c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Lock/OptionBuildable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ public extension OptionBuildable {
}

/// Support Page URL. By default is not set.
var supportPage: String {
var supportPage: String? {
get {
guard let url = self.supportURL else { return "" }
guard let url = self.supportURL else { return nil }
return url.absoluteString
}
set {
guard let url = URL(string: newValue) else { return } // FIXME: log error
guard let value = newValue, let url = URL(string: value) else { return } // FIXME: log error
self.supportURL = url
}
}
Expand Down
4 changes: 2 additions & 2 deletions LockTests/OptionsSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class OptionsSpec: QuickSpec {
expect(options.supportURL).to(beNil())
}

it("should have Auth0 support as empty String") {
expect(options.supportPage) == ""
it("should return Auth0 supportPage as nil") {
expect(options.supportPage).to(beNil())
}

it("should have openid as scope") {
Expand Down

0 comments on commit 7b8b70c

Please sign in to comment.