Fix potential crash in gca-diagnostic-message get_preferred_height()