Skip to content

Commit

Permalink
Add minor null check
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Apr 17, 2014
1 parent 5d27b09 commit 1650178
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions webcam-capture-drivers/driver-fswebcam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ public class TakePictureExample {
}
```

The snapshot version is available in the Sonatype Snapshot Maven repository:

<repository>
<id>Sonatype OSS Snapshot Repository</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

Dependency:

<dependency>
<groupId>com.github.sarxos</groupId>
<artifactId>webcam-capture-driver-fswebcam</artifactId>
<version>0.3.10-SNAPSHOT</version>
</dependency>

It can be also downloaded manually from:

https://oss.sonatype.org/content/repositories/snapshots/com/github/sarxos/webcam-capture-driver-fswebcam/0.3.10-SNAPSHOT


## Issues

There are several known issues. If you have an idea of how those can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,15 @@ public Dimension getResolution() {

@Override
public void setResolution(Dimension size) {

if (size == null) {
throw new IllegalArgumentException("Size cannot be null");
}

if (open.get()) {
throw new IllegalStateException("Cannot change resolution when webcam is open, please close it first");
}

this.size = size;
}

Expand Down Expand Up @@ -233,6 +239,9 @@ public void open() {
if (size == null) {
size = getResolutions()[0];
}
if (size == null) {
throw new RuntimeException("The resolution size cannot be null");
}

LOG.debug("Webcam device {} starting session, size {}", device.getIdentifierStr(), size);

Expand Down

0 comments on commit 1650178

Please sign in to comment.