Closed dsperling closed 8 years ago
The following code crashes on Linux, but works on the Mac:
redis.set("key", value: "") {(wasSet: Bool, error: NSError?) in }
The resulting error is: fatal error: unexpectedly found nil while unwrapping an Optional value
fatal error: unexpectedly found nil while unwrapping an Optional value
This is caused by the Linux version of NSString.data(encoding:) returning nil on an empty string.
The function causing the issue is issueCommand() in RedisResp.swift
internal func issueCommand(_ stringArgs: [String], callback: (RedisResponse) -> Void) { ... for arg in stringArgs { addAsBulkString(StringUtils.toUtf8String(arg)!, to: buffer) } ...
This fix could be in issueCommand, or lower in KituraSys -> StringUtils.toUtf8String.
The following code crashes on Linux, but works on the Mac:
The resulting error is:
fatal error: unexpectedly found nil while unwrapping an Optional value
This is caused by the Linux version of NSString.data(encoding:) returning nil on an empty string.
The function causing the issue is issueCommand() in RedisResp.swift
This fix could be in issueCommand, or lower in KituraSys -> StringUtils.toUtf8String.