Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86d13f3d authored by Masaaki Iwaguchi's avatar Masaaki Iwaguchi Committed by Ed Savage-Jones
Browse files

Avoid NPE in printspooler when changing language

PrintActivity is recreated when the language setting is changed.
As a result of the recreation mCurrentPrinter is null, which causes
a NullPointerException when onActivityResult() is called.

The issue is solved with a simple null check.

Change-Id: Ic58f0ca01577d2ec02d494739f3bc2f06240dd44
parent 82eeb2f2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -655,10 +655,12 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
            }
        }

        if (mCurrentPrinter != null) {
            PrinterId printerId = mCurrentPrinter.getId();
            final int index = mDestinationSpinnerAdapter.getPrinterIndex(printerId);
            mDestinationSpinner.setSelection(index);
        }
    }

    private void startAdvancedPrintOptionsActivity(PrinterInfo printer) {
        ComponentName serviceName = printer.getId().getServiceName();