Copilot commented on code in PR #6240:
URL: https://github.com/apache/texera/pull/6240#discussion_r3540106070


##########
frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts:
##########
@@ -778,7 +778,7 @@ export class WorkflowActionService {
    * @param workflow
    */
   public setTempWorkflow(workflow: Workflow): void {
-    if (this.texeraGraph.sharedModel.wsProvider.shouldConnect) {
+    if (this.texeraGraph.sharedModel.wsProvider?.shouldConnect) {
       this.texeraGraph.sharedModel.wsProvider.disconnect();
     }

Review Comment:
   `wsProvider` is now optional, but the disconnect call is still made via a 
non-optional access. Depending on TS control-flow narrowing, this can either be 
a compile-time error ("object is possibly undefined") or a future runtime risk 
if the guard changes. Use optional chaining for the disconnect call as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to