fixed crash when checking current diagram if no one diagram is opened
fixed crash when checking current diagram if no one diagram is opened

iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal,iakov/qreal