Skip to content

Commit cba920e

Browse files
committed
guard event reference
1 parent 0d1a97f commit cba920e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Ziti.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,10 @@ import CZitiPrivate
979979

980980
// update ourself
981981
if event.type == ZitiEvent.EventType.ConfigEvent {
982-
let cfgEvent = event.configEvent!
982+
guard let cfgEvent = event.configEvent else {
983+
log.warn( "invalid config event", function:"onEvent()")
984+
return
985+
}
983986
if !cfgEvent.controllerUrl.isEmpty { mySelf.id.ztAPI = cfgEvent.controllerUrl }
984987
if !cfgEvent.controllers.isEmpty { mySelf.id.ztAPIs = cfgEvent.controllers }
985988
if !cfgEvent.cert.isEmpty {

0 commit comments

Comments
 (0)