Fix potential crash case

Not entirely sure this is the correct solution, but it fixed the issue.

Signed-off-by: Eddie Ringle <eddie@eringle.net>