mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Don't break on comments in theme decoding
This commit is contained in:
@@ -333,6 +333,10 @@ public func makePresentationTheme(data: Data, resolvedWallpaper: TelegramWallpap
|
||||
var currentLevel = topLevel
|
||||
|
||||
for line in lines {
|
||||
let trimmedLine = line.trimmingCharacters(in: .whitespaces)
|
||||
if trimmedLine.hasPrefix("#") || trimmedLine.hasPrefix("//") {
|
||||
continue
|
||||
}
|
||||
if let rangeOfColon = line.firstIndex(of: ":") {
|
||||
let key = line.prefix(upTo: rangeOfColon)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user