Skip to content

Commit

Permalink
Fix optionality
Browse files Browse the repository at this point in the history
  • Loading branch information
theospears committed May 12, 2024
1 parent bb8fe7a commit 2fdc4a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BeeKit/Goal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Goal {
public var won: NSNumber = 0
public var yaw: NSNumber = 0
public var safebump: NSNumber?
public var safebuf: NSNumber?
public var safebuf: NSNumber = 0
public var curval: NSNumber?
public var limsum: String?
public var safesum: String?
Expand Down Expand Up @@ -85,7 +85,7 @@ public class Goal {
self.yaw = json["yaw"].number!
self.limsum = json["limsum"].string
self.safesum = json["safesum"].string
self.safebuf = json["safebuf"].number
self.safebuf = json["safebuf"].number!
self.use_defaults = json["use_defaults"].bool! as NSNumber
self.safebump = json["safebump"].number
self.curval = json["curval"].number
Expand All @@ -104,7 +104,7 @@ public class Goal {
}

public var countdownColor :UIColor {
guard let buf = self.safebuf?.intValue else { return UIColor.beeminder.gray }
let buf = self.safebuf.intValue
if buf < 1 {
return UIColor.beeminder.red
}
Expand Down

0 comments on commit 2fdc4a8

Please sign in to comment.