Merge "Fix for a Launcher crash."
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index c337c30..cba1a3b 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -732,10 +732,12 @@
                         getLocationOnScreen(mTempCell);
                         // Send a tap to the wallpaper if the last down was on empty space
                         final int pointerIndex = ev.findPointerIndex(mActivePointerId);
-                        mWallpaperManager.sendWallpaperCommand(getWindowToken(), 
-                                "android.wallpaper.tap",
-                                mTempCell[0] + (int) ev.getX(pointerIndex),
-                                mTempCell[1] + (int) ev.getY(pointerIndex), 0, null);
+                        if (pointerIndex >= 0) {
+                            mWallpaperManager.sendWallpaperCommand(getWindowToken(),
+                                    "android.wallpaper.tap",
+                                    mTempCell[0] + (int) ev.getX(pointerIndex),
+                                    mTempCell[1] + (int) ev.getY(pointerIndex), 0, null);
+                        }
                     }
                 }