Skip to content

pigeon objc static analysis problem with ternary conditional nil checks #63966

@gaaclarke

Description

@gaaclarke
 - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:59:51: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:111:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:112:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:132:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:133:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:152:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:153:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:169:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue

From @jmagman:

Instead of (self.textureId ? self.textureId : [NSNull null]) you need to say (self.textureId != nil ? self.textureId : [NSNull null])

Spawned from:
flutter/plugins#2922

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions