Permalink
Browse files

Camera Calibration: Fix hangup and null pointer exception

  • Loading branch information...
mgmax authored and t-oster committed Sep 2, 2018
1 parent fe1b60a commit af8129d9a46fc7ca15ef51a57dbeab3f25de6510
@@ -119,6 +119,9 @@ public void fetchFreshImage() {
if (src != null)
{
URLConnection conn = src.openConnection();
conn.setConnectTimeout(5 * 1000); // 5s connect timeout
conn.setReadTimeout(30 * 1000); // 30s read timeout after connecting
// HTTP authentication
if (VisicutModel.getInstance() != null && VisicutModel.getInstance().getSelectedLaserDevice() != null)
@@ -150,6 +153,9 @@ public void fetchFreshImage() {
private void refreshImagePoints()
{
if (backgroundImage == null) {
return;
}
int numPriorPoints = 0;
if (modifiedImagePoints == null) {
modifiedImagePoints = new Point2D.Double[numAlignmentPoints];
@@ -266,6 +266,8 @@ public static String getHumanReadableErrorMessage(Throwable cause, String text,
boolean emptyMessage = cause.getMessage() == null || cause.getMessage().trim().length() == 0;
if (alwaysShowStacktrace ||
cause.getClass().equals(NullPointerException.class) ||
cause.getClass().equals(ArrayIndexOutOfBoundsException.class) ||
cause.getClass().equals(ClassCastException.class) ||
(cause.getClass().equals(Exception.class) && emptyMessage))
{
StackTraceElement[] stackTrace = cause.getStackTrace();

0 comments on commit af8129d

Please sign in to comment.