Skip to content

App crashes if remote app returns nil for Date property #28

Description

@rinsuki

currently, if we generate Swift file from the Music app (com.apple.Music), MusicTrack have a releaseDate property with Date type:

// MARK: MusicTrack
@objc public protocol MusicTrack: MusicItem {
/* (snip) */
    @objc optional var releaseDate: Date { get } // the release date of this track

but, If try to get releaseDate property when Music app doesn't have current track (e.g. after re-opened), it will crash instead of returns nil:

image

but, If I change property type to Date? or NSDate manually, crash never occured (property returns nil).

maybe It is Apple-side issue (I'm not sure), but we might be want to include workaround for this.

Environment

  • Xcode: 16.1 (16B40)
  • macOS: 14.7 (23H124)
  • Chip: Apple M1 Max

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions