diff --git a/EventBus/src/org/greenrobot/eventbus/EventBus.java b/EventBus/src/org/greenrobot/eventbus/EventBus.java index e35ecd38..155e855b 100644 --- a/EventBus/src/org/greenrobot/eventbus/EventBus.java +++ b/EventBus/src/org/greenrobot/eventbus/EventBus.java @@ -358,7 +358,16 @@ public void removeAllStickyEvents() { } public boolean hasSubscriberForEvent(Class eventClass) { - List> eventTypes = lookupAllEventTypes(eventClass); + + List> eventTypes ; + + if(eventInheritance){ + eventTypes = lookupAllEventTypes(eventClass); + }else{ + eventTypes = new ArrayList<>(); + eventTypes.add(eventClass); + } + if (eventTypes != null) { int countTypes = eventTypes.size(); for (int h = 0; h < countTypes; h++) {