Skip to content

Commit

Permalink
More robust facade for getting Wifi AP Stations
Browse files Browse the repository at this point in the history
  • Loading branch information
jbguillois committed Apr 24, 2020
1 parent 1e3b5ce commit fe25bf0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.freebox</groupId>
<artifactId>freebox-java-helper</artifactId>
<packaging>jar</packaging>
<version>1.1.4</version>
<version>1.1.5</version>
<name>FreeBox Java Helper</name>

<properties>
Expand Down Expand Up @@ -137,6 +137,18 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
Expand Down Expand Up @@ -167,8 +179,6 @@
<artifactId>unirest-java</artifactId>
<version>3.1.02</version>
</dependency>


</dependencies>
</plugin>
</plugins>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/freebox/api/FreeBoxHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ public List<SessionInformation> getSessions() {
.header(X_FBX_APP_AUTH, freeboxSessionToken)
.asObject(GetSessionsApiResponse.class);

if(response.isSuccess()) {
if(response.isSuccess() && response.getBody()!=null) {
return response.getBody().getResult();
}
}

return Collections.emptyList();
}
Expand All @@ -403,7 +403,7 @@ public List<WifiAccessPoint> getWifiAccessPoints() {
.header(X_FBX_APP_AUTH, freeboxSessionToken)
.asObject(GetWifiAccessPointsApiResponse.class);

if(response.isSuccess()) {
if(response.isSuccess() && response.getBody()!=null) {
return response.getBody().getResult();
}

Expand All @@ -421,7 +421,7 @@ public List<WifiAccessPointStation> getWifiAccessPointStations(String apId) {
.header(X_FBX_APP_AUTH, freeboxSessionToken)
.asObject(GetWifiAccessPointStationsApiResponse.class);

if(response.isSuccess()) {
if(response.isSuccess() && response.getBody()!=null) {
return response.getBody().getResult();
}

Expand Down

0 comments on commit fe25bf0

Please sign in to comment.