Skip to content

Commit aee0da4

Browse files
Changed: Do not show toast if text null or empty
1 parent 87c8f3d commit aee0da4

File tree

1 file changed

+2
-1
lines changed
  • termux-shared/src/main/java/com/termux/shared/logger

1 file changed

+2
-1
lines changed

termux-shared/src/main/java/com/termux/shared/logger/Logger.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.widget.Toast;
88

99
import com.termux.shared.R;
10+
import com.termux.shared.data.DataUtils;
1011
import com.termux.shared.termux.TermuxConstants;
1112

1213
import java.io.IOException;
@@ -363,7 +364,7 @@ public static String getMultiLineLogStringEntry(String label, Object object, Str
363364

364365

365366
public static void showToast(final Context context, final String toastText, boolean longDuration) {
366-
if (context == null) return;
367+
if (context == null || DataUtils.isNullOrEmpty(toastText)) return;
367368

368369
new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, toastText, longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show());
369370
}

0 commit comments

Comments
 (0)