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

NPE when using Static Icons in the MenuManager #1193

Closed
jacobkeeler opened this issue Oct 8, 2019 · 0 comments
Closed

NPE when using Static Icons in the MenuManager #1193

jacobkeeler opened this issue Oct 8, 2019 · 0 comments
Assignees
Labels
bug A defect in the library

Comments

@jacobkeeler
Copy link
Contributor

jacobkeeler commented Oct 8, 2019

Bug Report

When attempting to use a Static Icon via the MenuManager, a NullPointerException occurs with the following stack trace:


2019-10-08 16:57:10.121 16451-16451/io.livio.sdltestsuite.app1 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: io.livio.sdltestsuite.app1, PID: 16451
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.smartdevicelink.proxy.rpc.enums.FileType.equals(java.lang.Object)' on a null object reference
        at com.smartdevicelink.managers.file.filetypes.SdlArtwork.setType(SdlArtwork.java:114)
        at com.smartdevicelink.managers.file.filetypes.SdlArtwork.clone(SdlArtwork.java:167)
        at com.smartdevicelink.managers.screen.menu.MenuCell.clone(MenuCell.java:336)
        at com.smartdevicelink.managers.screen.menu.BaseMenuManager.cloneMenuCellsList(BaseMenuManager.java:1339)
        at com.smartdevicelink.managers.screen.menu.BaseMenuManager.setMenuCells(BaseMenuManager.java:172)
        at com.smartdevicelink.managers.screen.menu.MenuManager.setMenuCells(MenuManager.java:45)
        at com.smartdevicelink.managers.screen.BaseScreenManager.setMenu(BaseScreenManager.java:429)
        at com.smartdevicelink.managers.screen.ScreenManager.setMenu(ScreenManager.java:45)

Related #848

Reproduction Steps
  1. Attempt to create a menu item with a static icon
Expected Behavior

The provided static icon appears in the HMI next to the specified menu item

Observed Behavior

App crashes with NullPointerException

OS & Version Information
  • Android Version: 9, Pixel 11 Emulator
  • SDL Android Version: develop branch
  • Testing Against: Core develop branch & Generic HMI develop branch
Test Case, Sample Code, and / or Example App
        final MenuCell A = new MenuCell("A", new SdlArtwork(StaticIconName.ACCEPT_CALL), null, new MenuSelectionListener() {
            @Override
            public void onTriggered(TriggerSource trigger) {
                messageLogger.logInfo(TAG, "A Triggered", true);
            }
        });
        
        sdlManager.getScreenManager().setMenu(Arrays.asList(A));
@joeygrover joeygrover self-assigned this Oct 8, 2019
@joeygrover joeygrover added the bug A defect in the library label Oct 8, 2019
joeygrover added a commit that referenced this issue Oct 10, 2019
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

3 participants