File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
core/src/main/java/com/google/adk/runner Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,9 @@ protected Flowable<Event> runAsyncImpl(
458458 Content newMessage ,
459459 RunConfig runConfig ,
460460 @ Nullable Map <String , Object > stateDelta ) {
461+ Preconditions .checkNotNull (session , "session cannot be null" );
462+ Preconditions .checkNotNull (newMessage , "newMessage cannot be null" );
463+ Preconditions .checkNotNull (runConfig , "runConfig cannot be null" );
461464 return Flowable .defer (
462465 () -> {
463466 BaseAgent rootAgent = this .agent ;
@@ -476,19 +479,14 @@ protected Flowable<Event> runAsyncImpl(
476479 .defaultIfEmpty (newMessage )
477480 .flatMap (
478481 content ->
479- (content != null )
480- ? appendNewMessageToSession (
481- session ,
482- content ,
483- initialContext ,
484- runConfig .saveInputBlobsAsArtifacts (),
485- stateDelta )
486- : Single .just (null ))
482+ appendNewMessageToSession (
483+ session ,
484+ content ,
485+ initialContext ,
486+ runConfig .saveInputBlobsAsArtifacts (),
487+ stateDelta ))
487488 .flatMapPublisher (
488489 event -> {
489- if (event == null ) {
490- return Flowable .empty ();
491- }
492490 // Get the updated session after the message and state delta are
493491 // applied
494492 return this .sessionService
You can’t perform that action at this time.
0 commit comments