Droppy icon indicating copy to clipboard operation
Droppy copied to clipboard

Fail dismissPopup on internal classes

Open javieramp opened this issue 8 years ago • 2 comments

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.

javieramp avatar Jul 31 '17 10:07 javieramp

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

davidvavra avatar Oct 08 '17 10:10 davidvavra

Great!

javieramp avatar Oct 23 '17 08:10 javieramp