ICU-4882 Check for zero matches returned from detectAll().

X-SVN-Rev: 18696
This commit is contained in:
Eric Mader 2005-10-18 16:28:18 +00:00
parent bb2a656476
commit 0815b9b16a

View file

@ -249,6 +249,11 @@ public class DetectingViewer extends JFrame implements ActionListener
char[] buffer = new char[1024];
int bytesRead = 0;
if (matches == null || matches.length == 0) {
errorDialog("Match Error", "No matches!");
return;
}
try {
StringBuffer sb = new StringBuffer();
String encoding = matches[0].getName();