fix: panic by nil pointer

This commit is contained in:
lilong.129
2024-09-12 11:12:05 +08:00
parent 6f6cefe4bc
commit a87a4ea680
4 changed files with 20 additions and 6 deletions

View File

@@ -35,7 +35,10 @@ func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ...
toX = float64(width) * toX
toY = float64(height) * toY
err = dExt.Driver.SwipeFloat(fromX, fromY, toX, toY, options...)
return errors.Wrap(code.MobileUISwipeError, err.Error())
if err != nil {
return errors.Wrap(code.MobileUISwipeError, err.Error())
}
return nil
}
func (dExt *DriverExt) SwipeTo(direction string, options ...ActionOption) (err error) {