add some "currentView" 0-pointer checks in konqueror/src/konqmainwindow.cp

Review Request #101586 - Created June 11, 2011 and submitted

Martin Koller
add some "currentView" 0-pointer checks in konqueror/src/konqmainwindow.cpp to avoid crashes like #272557

Dawit Alemayehu
Looks good, but can you also add Q_ASSERT(m_currentView) before the if (!m_currentView) checks so that in debug mode this will assert. The view should not be null and if it is someone needs to figure out why that is the case.
  1. as per our mail conversation:
    "Well if m_currentView can be NULL, then
    there is definitely no need to add a Q_ASSERT right ? I was not aware
    that it could be until you forwarded what David said ; so forget about
    my comment and handle it as David suggested."
    I found also now a way to actually make the current view disappear:
    start konqueror (in my case starts with empty page), select "Settings -> load view profile -> midnight commander"
    This closes the current view in konqi and opens a new window.
    Closing active view (Ctrl+Shift+W) crashes konqueror without this patch.
    I've committed/pushed it now