Skip to content

Commit

Permalink
fixed: Mouse::click: given Location should not be null (issue #299)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiMan committed Jan 30, 2020
1 parent 3254003 commit 487b8a9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions API/src/main/java/org/sikuli/script/Mouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
*/
package org.sikuli.script;

import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Random;

import org.sikuli.basics.Debug;
import org.sikuli.basics.Settings;
import org.sikuli.script.support.*;
import org.sikuli.util.Highlight;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Random;

/**
* Main pupose is to coordinate the mouse usage among threads <br>
* At any one time, the mouse has one owner (usually a Region object) <br>
Expand Down Expand Up @@ -183,12 +182,15 @@ public static boolean hasMoved() {
*
* wait before and after: &gt; 9 taken as milli secs - 1 ... 9 are seconds
*
* @param loc where to click
* @param loc where to click (not null)
* @param action L,R,M left, right, middle - D means double click
* @param args timing parameters
* @return the location
*/
public static Location click(Location loc, String action, Integer... args) {
if (null == loc) {
throw new IllegalArgumentException("Mouse: click: Location should not be null");
}
if (get().device.isSuspended() || loc.isOtherScreen()) {
return null;
}
Expand Down

0 comments on commit 487b8a9

Please sign in to comment.