Fix NPE in Lazarus GUI