fixed crash

This commit is contained in:
nuclearfog 2023-07-01 22:36:07 +02:00
parent 92a9566bb7
commit 3572ec6d68
No known key found for this signature in database
GPG Key ID: 03488A185C476379
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public class ErrorUtils {
public static void showErrorMessage(Context context, @Nullable ConnectionException exception) {
if (context != null) {
String errorMessage = getErrorMessage(context, exception);
if (errorMessage != null) {
if (!errorMessage.isEmpty()) {
Toast.makeText(context.getApplicationContext(), errorMessage, Toast.LENGTH_SHORT).show();
}
}
@ -70,7 +70,7 @@ public class ErrorUtils {
return context.getString(R.string.error_status_length);
case ConnectionException.INTERRUPTED:
return null; // ignore exceptions caused by task termination
return ""; // ignore exceptions caused by task termination
case ConnectionException.DUPLICATE_STATUS:
return context.getString(R.string.error_duplicate_status);