Fix crash when adding files from window menu

Introduced by 2ad3147542a45436733ddd7014993bcc3022a654

Task-number: QTCREATORBUG-12409
Change-Id: I422d315c5b9d22052251a0869d314adff7741af0
Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>