Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in main — "Invalid parameter not satisfying: numberOfValues > 0" #4248

Open
stuartbreckenridge opened this issue Mar 25, 2024 · 0 comments

Comments

@stuartbreckenridge
Copy link
Member

Crashing when creating placeholders. There's an underlying NSParameterAssert(numberOfValues > 0); in the rs_SQLValueListWithPlaceholders call.

func unreadCount(feedIDs: Set<String>, since: Date, database: FMDatabase) -> Int? {

    let placeholders = NSString.rs_SQLValueList(withPlaceholders: UInt(feedIDs.count))! // <-- Thread 2: "Invalid parameter not satisfying: numberOfValues > 0"
    let sql = "select count(*) from articles natural join statuses where feedID in \(placeholders) and (datePublished > ? or (datePublished is null and dateArrived > ?)) and read=0;"

    var parameters = [Any]()
    parameters += Array(feedIDs) as [Any]
    parameters += [since] as [Any]
    parameters += [since] as [Any]

    let unreadCount = database.count(sql: sql, parameters: parameters, tableName: name)
    return unreadCount
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant