diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-09-19 14:15:48 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2014-09-19 14:15:52 -0700 |
commit | 43835e006e2988f05ad30fb926ed958a832785c1 (patch) | |
tree | 4f4fdaa8f21f5a94c7600a170eb832501e01f67f /src/com/android/settings/print | |
parent | 6e1d8277e6c6443ad286bf25a7decb4f5a9b0cdf (diff) | |
download | packages_apps_Settings-43835e006e2988f05ad30fb926ed958a832785c1.zip packages_apps_Settings-43835e006e2988f05ad30fb926ed958a832785c1.tar.gz packages_apps_Settings-43835e006e2988f05ad30fb926ed958a832785c1.tar.bz2 |
Crash in Settings cancelling a print job from the job list.
bug:17585582
Change-Id: I44aef7e09c26141388b410762e93164d8df9a0c6
Diffstat (limited to 'src/com/android/settings/print')
-rw-r--r-- | src/com/android/settings/print/PrintJobSettingsFragment.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/settings/print/PrintJobSettingsFragment.java b/src/com/android/settings/print/PrintJobSettingsFragment.java index a72fa7d..34db97b 100644 --- a/src/com/android/settings/print/PrintJobSettingsFragment.java +++ b/src/com/android/settings/print/PrintJobSettingsFragment.java @@ -112,13 +112,18 @@ public class PrintJobSettingsFragment extends SettingsPreferenceFragment { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); - if (!getPrintJob().getInfo().isCancelling()) { + PrintJob printJob = getPrintJob(); + if (printJob == null) { + return; + } + + if (!printJob.getInfo().isCancelling()) { MenuItem cancel = menu.add(0, MENU_ITEM_ID_CANCEL, Menu.NONE, getString(R.string.print_cancel)); cancel.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); } - if (getPrintJob().isFailed()) { + if (printJob.isFailed()) { MenuItem restart = menu.add(0, MENU_ITEM_ID_RESTART, Menu.NONE, getString(R.string.print_restart)); restart.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); |