Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_view3d / view3d_view.c
index 11b011dbc733d38c532e2a8788b731933394c203..854f71b17b3584df99130df25261cffac77d4187 100644 (file)
@@ -1198,7 +1198,7 @@ int view3d_opengl_select(
        hits = GPU_select_end();
        
        /* second pass, to get the closest object to camera */
-       if (do_passes) {
+       if (do_passes && (hits > 0)) {
                GPU_select_begin(buffer, bufsize, &rect, GPU_SELECT_NEAREST_SECOND_PASS, hits);
 
 #ifdef WITH_OPENGL_LEGACY