Skip to content

Commit f2f9795

Browse files
Merge pull request #145 from wordpress-mobile/fix/eventbus_exception_invoking_subscriber_failed
Fix NullPointerException in AppLog.addEntry
2 parents 09ebdc1 + d8c8e04 commit f2f9795

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ In the following cases, the CI will publish a new version with the following for
2727

2828
- [WordPress for Android][2]
2929
- [FluxC][3]
30+
- [Woo for Android][4]
3031

3132
## License
3233
Dual licensed under MIT, and GPL.
3334

3435
[1]: https://github.com/wordpress-mobile/WordPress-Utils-Android/blob/a9fbe8e6597d44055ec2180dbf45aecbfc332a20/WordPressUtils/build.gradle#L37
3536
[2]: https://github.com/wordpress-mobile/WordPress-Android
3637
[3]: https://github.com/wordpress-mobile/WordPress-FluxC-Android
38+
[4]: https://github.com/woocommerce/woocommerce-android

WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,12 @@ private static void addEntry(T tag, LogLevel level, String text) {
305305

306306
// Call our listeners if any
307307
for (AppLogListener listener : currentListeners) {
308-
listener.onLog(tag, level, text);
308+
if (listener != null) {
309+
listener.onLog(tag, level, text);
310+
} else {
311+
// Log a warning
312+
w(T.UTILS, "AppLogListener is null when attempting to log.");
313+
}
309314
}
310315
// Record entry if enabled
311316
if (mEnableRecording) {

0 commit comments

Comments
 (0)