Skip to content

Commit

Permalink
Fix/dtx panic (#130)
Browse files Browse the repository at this point in the history
forgot to handle an error that would crash with a panic instead of warning that the developer image was missing
  • Loading branch information
danielpaulus authored Apr 23, 2022
1 parent 7878cad commit 204eb25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ios/dtx_codec/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ type GlobalDispatcher struct {
const requestChannel = "_requestChannelWithCode:identifier:"

//Close closes the underlying deviceConnection
func (dtxConn *Connection) Close() {
dtxConn.deviceConnection.Close()
func (dtxConn *Connection) Close() error {
if dtxConn.deviceConnection != nil {
return dtxConn.deviceConnection.Close()
}
return nil
}

//GlobalChannel returns the connections automatically created global channel.
Expand Down
3 changes: 3 additions & 0 deletions ios/testmanagerd/xcuitestrunner_11.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func RunXCUIWithBundleIds11(
}
log.Debugf("test session setup ok")
conn, err := dtx.NewConnection(device, testmanagerd)
if err != nil {
return err
}
defer conn.Close()
ideDaemonProxy := newDtxProxyWithConfig(conn, testConfig)

Expand Down

0 comments on commit 204eb25

Please sign in to comment.