QmlDesigner: adding check for null pointer

Better save then sorry.

Change-Id: Ica022c37be8beab0d99a9c1aaf2d5fa15d7141e6
Reviewed-by: Marco Bubke <marco.bubke@digia.com>