fix a first-time start crash bug

This should fix the runaway exception crash which occurs when a user starts the Qt client for the first time.