Fixed #5244 (FP: (error) Uninitialized variable: ptr - initialization within if-clause)