Skip to content

Commit

Permalink
check for lists instead of arrays (openhab#559)
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <[email protected]>
  • Loading branch information
kaikreuzer authored and maggu2810 committed Feb 11, 2019
1 parent e96aa52 commit 0197896
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ private String getServiceId(ServiceReference<?> serviceReference) {
if (pid != null) {
if (pid instanceof String) {
return (String) pid;
} else {
String[] pidArray = (String[]) pid;
if (pidArray.length > 0) {
return pidArray[0];
} else if (pid instanceof List) {
@SuppressWarnings("unchecked")
List<String> pidList = (List<String>) pid;
if (!pidList.isEmpty()) {
return pidList.get(0);
}
}
}
Expand Down

0 comments on commit 0197896

Please sign in to comment.