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 in SoftButtonReplaceOperation #1767

Closed
JulianKast opened this issue Nov 17, 2021 · 1 comment
Closed

NPE in SoftButtonReplaceOperation #1767

JulianKast opened this issue Nov 17, 2021 · 1 comment
Labels
bug A defect in the library manager-screen Relating to the manager layer - screen managers

Comments

@JulianKast
Copy link
Contributor

Bug Report

Npe can occur under certain circumstances when changing layouts and updating soft buttons at the same time.

NPE occurs on line 54 of SoftButtonReplaceOperation, supportsSoftButtonImages() returns null in the test case outlined in this issue.

        if (!supportsSoftButtonImages()) {
Reproduction Steps
  1. Set Template that does not support Softbuttons
  2. In batch update change the layout to one that does support Softbuttons and add Softbuttons in the update
Expected Behavior

Soft buttons appear on screen, All taskMaster operations are functional

Observed Behavior

TaskMaster task stop working,

OS & Version Information
  • Android Version: 11
  • SDL Android Version: 5.3.0
  • Testing Against: manticore
Test Case, Sample Code, and / or Example App
        TemplateConfiguration templateConfiguration = new TemplateConfiguration().setTemplate(PredefinedLayout.GRAPHIC_WITH_TEXTBUTTONS.toString());

SoftButtonState softButtonState = new SoftButtonState("State1", "Text1", null);

        SoftButtonObject softButtonObject = new SoftButtonObject("Button1", softButtonState, new SoftButtonObject.OnEventListener() {
            @Override
            public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {

            }

            @Override
            public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {

            }
        });
List<SoftButtonObject> softButtonObjectList = Arrays.asList(softButtonObject);

        sdlManager.getScreenManager().beginTransaction();
        sdlManager.getScreenManager().setTextField1(textField1);
        sdlManager.getScreenManager().setTextField2(textField2);
        sdlManager.getScreenManager().setTextField2(textField3);
        sdlManager.getScreenManager().setTextField2(textField4);
        sdlManager.getScreenManager().setTitle(titleField);
        sdlManager.getScreenManager().setSoftButtonObjects(softButtonObjectList);
        sdlManager.getScreenManager().changeLayout(templateConfiguration, null);
        sdlManager.getScreenManager().commit(new CompletionListener() {
            @Override
            public void onComplete(boolean success) {
            }
        });
@joeljfischer joeljfischer added bug A defect in the library manager-screen Relating to the manager layer - screen managers labels Nov 17, 2021
@RHenigan
Copy link
Contributor

RHenigan commented Dec 8, 2021

This issue was fixed and resolved in the 5.3.1 Hotfix release.
As part of PR #1773

@RHenigan RHenigan closed this as completed Dec 8, 2021
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 manager-screen Relating to the manager layer - screen managers
Projects
None yet
Development

No branches or pull requests

3 participants