Skip to content

Commit

Permalink
Fix potential NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicallyCoded committed Sep 11, 2021
1 parent 30b257f commit 3b950fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/me/danjono/inventoryrollback/data/YAML.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ public List<Long> getSelectedPageTimestamps(int pageNumber) {
public void purgeExcessSaves(int deleteAmount) {
List<Long> timeSaved = new ArrayList<>();

for (File file : backupFolder.listFiles()) {
File[] backupFiles = backupFolder.listFiles();
if (backupFiles == null) return;

for (File file : backupFiles) {
if (file.isDirectory())
continue;

Expand Down

0 comments on commit 3b950fe

Please sign in to comment.