Skip to content

Commit decf573

Browse files
committed
Backport libK3b bugfixes from APhotoManager
1 parent 21ecfee commit decf573

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ before_install:
3333

3434
script:
3535
- jdk_switcher use oraclejdk8
36-
- ./gradlew assemble libK3bZip:test
36+
- ./gradlew assemble libK3b:test libK3bZip:test

libK3b/src/main/java/de/k3b/io/DateUtil.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Copyright (c) 2016-2017 by k3b.
2+
* Copyright (c) 2016-2018 by k3b.
33
*
4-
* This file is part of AndroFotoFinder / #APhotoManager.
4+
* This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
55
*
66
* This program is free software: you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by
@@ -58,11 +58,13 @@ public static Date parseIsoDate(String dateString) {
5858

5959
private static Date parseDateTime(String dateString, DateFormat... formatCandidates) {
6060
Date result = null;
61-
for (DateFormat formatCandidate : formatCandidates) {
62-
try {
63-
result = formatCandidate.parse(dateString);
64-
if (result != null) break;
65-
} catch (ParseException e) {
61+
if (dateString != null) {
62+
for (DateFormat formatCandidate : formatCandidates) {
63+
try {
64+
result = formatCandidate.parse(dateString);
65+
if (result != null) break;
66+
} catch (ParseException e) {
67+
}
6668
}
6769
}
6870
return result;

libK3b/src/main/java/de/k3b/io/ListUtils.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Copyright (c) 2017 by k3b.
2+
* Copyright (c) 2017-2018 by k3b.
33
*
4-
* This file is part of AndroFotoFinder / #APhotoManager.
4+
* This file is part of AndroFotoFinder / #APhotoManager and toGoZip.
55
*
66
* This program is free software: you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by
@@ -52,8 +52,11 @@ public static List<String> toStringList(Iterable<?> list) {
5252

5353
public static List<String> toStringList(Object... list) {
5454
ArrayList<String> result = new ArrayList<String>();
55-
for (Object item : list) {
56-
if (item != null) result.add(item.toString());
55+
56+
if (list != null) {
57+
for (Object item : list) {
58+
if (item != null) result.add(item.toString());
59+
}
5760
}
5861
return result;
5962
}

libK3b/src/main/java/de/k3b/libk3b/myClass.java

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)