Olá. Estou com o seguinte problema. Ao tentar executar o app nesta etapa, ele quebra ao clicar no botão Realizar pagamento, aparecendo o seguinte erro:
2020-08-24 18:55:50.433 32271-32271/br.com.alura.aluraviagens E/AndroidRuntime: FATAL EXCEPTION: main
Process: br.com.alura.aluraviagens, PID: 32271
java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.alura.aluraviagens/br.com.alura.aluraviagens.ui.activity.PagamentoActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.math.BigDecimal br.com.alura.aluraviagens.model.Pacote.getPreco()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.math.BigDecimal br.com.alura.aluraviagens.model.Pacote.getPreco()' on a null object reference
at br.com.alura.aluraviagens.ui.activity.PagamentoActivity.mostraPreco(PagamentoActivity.java:48)
at br.com.alura.aluraviagens.ui.activity.PagamentoActivity.onCreate(PagamentoActivity.java:30)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)