Work around a weird NPE inside the clipboard library

git-svn-id: https://zxing.googlecode.com/svn/trunk@2539 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-11-28 21:45:57 +00:00
parent 126f33815e
commit 69167c6bdc

View file

@ -556,7 +556,12 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
if (copyToClipboard && !resultHandler.areContentsSecure()) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
if (displayContents != null) {
clipboard.setText(displayContents);
try {
clipboard.setText(displayContents);
} catch (NullPointerException npe) {
// Some kind of bug inside the clipboard implementation, not due to null input
Log.w(TAG, "Clipboard bug", npe);
}
}
}
}