Fix an occasional crash in print job state fragment in Settings.
There is a NPE in the print settings if the following occurs: We open the print job state UI in settings for an ongoing print job (now we have action bar buttons for cancel and restart); now the print job gets completed and we update the UI and since the print job is not longer present we nullify the current job reference and finish the activity. But since activity is not finished immediately there is an opportunity for the user to click on the action bar options which results in NPE. The fix is to not update the print job instance in the update UI method if the job is not available, i.e. the update method does not mutate state if the job is no longer present, as we are finishing and performing an operation on a finished job will have no effect. bug:17387134 Change-Id: I501ed1e05b8b70584b3299a16e93ead5ab7f155f
Loading
Please register or sign in to comment