Skip to content

Commit

Permalink
Fix NPE on shutdown in gnome
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwr committed Mar 20, 2024
1 parent 61d9025 commit f1ceb12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/jthemedetecor/GnomeThemeDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public void run() {
while (!this.isInterrupted()) {
//Expected input = gtk-theme: '$GtkThemeName'
String readLine = reader.readLine();

// reader.readLine sometimes returns null on application shutdown.
if (readLine == null) {
continue;
}

if (!outputPattern.matcher(readLine).matches()) {
continue;
}
Expand Down

0 comments on commit f1ceb12

Please # to comment.