Skip to content

Commit

Permalink
Return null instead of throwing exception, refs #267
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Oct 19, 2014
1 parent 2c908ca commit 1081ed6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ public void setResolution(Dimension size) {
public synchronized BufferedImage getImage() {

if (!open) {
throw new WebcamException("IpCam device not open");
return null;
}

if (mode == null) {
throw new IllegalArgumentException("Camera mode cannot be null!");
throw new IllegalStateException("Camera mode cannot be null!");
}

switch (mode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@


/**
* This is interface for all webcam drivers.
* Webcam drivers abstraction. The webcam driver (or capture driver, as it is
* often referred) is a factory for specific webcam device implementations.
*
* @author Bartosz Firyn (SarXos)
*/
Expand Down

0 comments on commit 1081ed6

Please sign in to comment.