From 0fc8ee5ace22c11175cb93f5b6f7310cc4d646c1 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 15 Jun 2024 14:48:37 +0200 Subject: [PATCH] Prevent division by zero Fixes crash reported at https://marc.info/?l=lyx-users&m=171842978728676 --- src/insets/InsetTabular.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1f7cc33ba4..7fddfab7c3 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1330,7 +1330,7 @@ bool Tabular::updateColumnWidths(MetricsInfo & mi) changed = true; } } - if (changed && restwidth > 0) + if (changed && restwidth > 0 && restcols != 0) vcolwidth = restwidth / restcols; } -- 2.39.5