File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ public void post(Object event) {
193193 * @param tag 事件的tag, 类似于BroadcastReceiver的action
194194 */
195195 public void post (Object event , String tag ) {
196+ if (event == null ) {
197+ Log .e (this .getClass ().getSimpleName (), "The event object is null" );
198+ return ;
199+ }
196200 mLocalEvents .get ().offer (new EventType (event .getClass (), tag ));
197201 mDispatcher .dispatchEvents (event );
198202 }
@@ -213,11 +217,13 @@ public void postSticky(Object event) {
213217 * @param tag 事件tag
214218 */
215219 public void postSticky (Object event , String tag ) {
220+ if (event == null ) {
221+ Log .e (this .getClass ().getSimpleName (), "The event object is null" );
222+ return ;
223+ }
216224 EventType eventType = new EventType (event .getClass (), tag );
217225 eventType .event = event ;
218226 mStickyEvents .add (eventType );
219- // 处理sticky事件
220- // mDispatcher.handleStickyEvent(eventType, null);
221227 }
222228
223229 public void removeStickyEvent (Class <?> eventClass ) {
You can’t perform that action at this time.
0 commit comments