mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Fix a few possible rare NPEs
git-svn-id: https://zxing.googlecode.com/svn/trunk@2335 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
024829cea4
commit
b3f03373c2
|
@ -624,7 +624,10 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
||||||
|
|
||||||
if (copyToClipboard && !resultHandler.areContentsSecure()) {
|
if (copyToClipboard && !resultHandler.areContentsSecure()) {
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
clipboard.setText(resultHandler.getDisplayContents());
|
CharSequence text = resultHandler.getDisplayContents();
|
||||||
|
if (text != null) {
|
||||||
|
clipboard.setText(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source == IntentSource.NATIVE_APP_INTENT) {
|
if (source == IntentSource.NATIVE_APP_INTENT) {
|
||||||
|
|
|
@ -80,6 +80,9 @@ public final class ViewfinderView extends View {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDraw(Canvas canvas) {
|
public void onDraw(Canvas canvas) {
|
||||||
|
if (cameraManager == null) {
|
||||||
|
return; // not ready yet, early draw before done configuring
|
||||||
|
}
|
||||||
Rect frame = cameraManager.getFramingRect();
|
Rect frame = cameraManager.getFramingRect();
|
||||||
if (frame == null) {
|
if (frame == null) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue