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

SDLAddCommand iconValue of nil results in INVALID_DATA #846

Closed
Invader-Zim opened this issue Jan 17, 2018 · 4 comments
Closed

SDLAddCommand iconValue of nil results in INVALID_DATA #846

Invader-Zim opened this issue Jan 17, 2018 · 4 comments
Labels
bug A defect in the library
Milestone

Comments

@Invader-Zim
Copy link

Invader-Zim commented Jan 17, 2018

Bug Report

SDLAddCommand needs an initializer that accepts a parentId, but does not require an iconValue or iconType; OR allow this initializer to accept nil for iconValue/iconType.

Reproduction Steps
  1. Pass "nil" for the iconValue parameter on the SDLAddCommand initializer
(instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(nullable SDLRPCCommandNotificationHandler)handler;
Expected Behavior

Either need an additional SDLAddCommand initializer that allows a parentId but removes the iconValue/iconType, OR allow nil to be passed for iconValue/iconType on the current initializer.

Observed Behavior
Error Domain=com.sdl.lifecyclemanager.error Code=-1 "INVALID_DATA" UserInfo={NSLocalizedRecoverySuggestion=Have you tried turning it off and on again?, NSLocalizedDescription=INVALID_DATA, NSLocalizedFailureReason=}
OS & Version Information
  • iOS Version: iOS 11 (but that's irrelevant)
  • SDL iOS Version: 5.0.0
  • Testing Against: Toyota and Ford head units - not sure of the details
Test Case, Sample Code, and / or Example App
@joeljfischer joeljfischer added the bug A defect in the library label Jan 18, 2018
@joeljfischer joeljfischer added this to the 5.2.0 milestone Jan 18, 2018
joeljfischer added a commit that referenced this issue Jan 29, 2018
* Allow AddCommand initializer to create a command with a parent but no icon
@joeljfischer
Copy link
Contributor

@Invader-Zim I'm not sure I'm totally understanding how not having access to an initializer is causing an INVALID_DATA. A does not lead to B. If the initializer doesn't work to create the exact type of object you want, that's fine and it can be fixed. But what, exactly, are you doing to cause an INVALID_DATA error?

@Invader-Zim
Copy link
Author

There are too many initializers. I don't want to set an icon, I just want to specify the parent id. If I pass nil for the icon arguments, I get an INVALID_DATA. Personally, I have a work around; but I'm sure you want the interface to be friendly. If you don't want to add overload, then just make tolerate supplying nil for the icon args.

Are you saying that when you pass nil for the icon args, you DON'T get INVALID_DATA?? If so, then either I have something else going wrong on my end - or a recent update has already addressed the issue.

@joeljfischer
Copy link
Contributor

Thanks @Invader-Zim, I think I'm starting to understand the issue.

I'm just trying to understand the issue here. The nullability on the initializer you mention specified that those parameters must be nonnull, so I wasn't aware you were actually using them as nullable. I think the solution will be to make those parameters nullable and allow for that use case.

@Invader-Zim
Copy link
Author

solution will be to make those parameters nullable and allow for that use case
Perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

No branches or pull requests

2 participants