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

Fail dismissPopup on internal classes #54

Open
javieramp opened this issue Jul 31, 2017 · 2 comments
Open

Fail dismissPopup on internal classes #54

javieramp opened this issue Jul 31, 2017 · 2 comments

Comments

@javieramp
Copy link

javieramp commented Jul 31, 2017

This is the trace of the fail:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference at com.shehabic.droppy.DroppyMenuPopup.dismissPopup (DroppyMenuPopup.java:155) at com.shehabic.droppy.DroppyMenuPopup.dismiss (DroppyMenuPopup.java:150) at com.shehabic.droppy.DroppyMenuPopup$2.onClick (DroppyMenuPopup.java:105)

This is the piece of code where i build DroppyMenu:

 ` if (hasAnyProducts() && productIBTN != null) {
        DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(this, productIBTN);

        for (Product product : getAvailableProductList()) {
            Drawable drawable = DrawableSquare.getDrawable(this, product);
            if (drawable != null) {
                DroppyMenuItem droppyMenuItem = new DroppyMenuItem(product.getName());
                droppyMenuItem.setIcon(drawable);

                droppyBuilder.addMenuItem(droppyMenuItem)
                        .addSeparator();
            }
        }

        droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
            @Override
            public void call(View v, int id) {
                e("DroppyMenuPopup", "Clicked on: " + String.valueOf(id));

                if (hasAnyProducts()) {
                    setSelectedProduct(id);
                    setReservationDates();
                    updateBookingFragment();
                    showBusinessPrivateSelector(hasToShowSelectorPrivateBusiness());
                    refreshUsageSelectorUI();
                    reloadMapParkingsAndSetToDefaultUI();
                }
            }
        });

        droppyBuilder.build();
    }`

The occurrences are at any mobile, by example: SM-J510FN, Aquaris X5 Plus, Moto G Play, HUAWEI MLA-L11, ONEPLUS A3003, E2303, SM-G920F, Aquaris M5.5, ... and any version of Android 5.X, 6.X or 7.X.

I can't protect my project code because fail is at internal classes.
Rollbar is from time to time sending me bugs related to this and I can not do anything when I would arrive with check, in my opinion, before making the DroppyMenu dismiss check if the view is null.
Please you could do something about this so that this does not continue.

The way to reproduce this myself or the users is by repeatedly clicking on the DroppyMenuButton without time to load the contents of the DroppyButton menu.

@davidvavra
Copy link

davidvavra commented Oct 8, 2017

Hi, we have released our fork which fixes this to the jcenter: compile 'io.stepuplabs.droppy:droppy:0.6.1.0'

@javieramp
Copy link
Author

Great!

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

No branches or pull requests

2 participants