diff --git a/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java b/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java index 1166a64b47a..7be2ae1dccd 100644 --- a/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java +++ b/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java @@ -156,7 +156,8 @@ private static void verifyButtonText(Button button) { //if (size.y/preferred.y) == X, then label spans X lines, so divide //the calculated value of preferred.x by X if (preferred.y * size.y > 0) { - preferred.y /= button.getText().lines().count(); // check for '\n\' + String buttonText = button.getText(); + preferred.y /= buttonText.isEmpty() ? 1 : buttonText.lines().count(); // check for '\n\' if (size.y / preferred.y > 1) { preferred.x /= (size.y / preferred.y); }