Merge "Verify attached before showing a dialog" into jb-dev