File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
kotlin/com/njlabs/showjava/activities/decompiler Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,13 @@ class DecompilerActivity : BaseActivity() {
126126 }
127127 .subscribeOn(Schedulers .io())
128128 .observeOn(AndroidSchedulers .mainThread())
129+ .onErrorReturn {
130+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
131+ resources.getDrawable(R .drawable.ic_list_generic, null )
132+ } else {
133+ resources.getDrawable(R .drawable.ic_list_generic)
134+ }
135+ }
129136 .subscribe { itemIcon.setImageDrawable(it) }
130137 )
131138
@@ -134,7 +141,12 @@ class DecompilerActivity : BaseActivity() {
134141
135142 private fun loadPackageInfoFromIntent () {
136143 if (intent.dataString.isNullOrEmpty()) {
137- packageInfo = intent.getParcelableExtra(" packageInfo" )
144+ if (intent.hasExtra(" packageInfo" )) {
145+ packageInfo = intent.getParcelableExtra(" packageInfo" )
146+ } else {
147+ Toast .makeText(context, R .string.errorLoadingInputFile, Toast .LENGTH_SHORT ).show()
148+ finish()
149+ }
138150 } else {
139151 val info = PackageInfo .fromFile(
140152 context,
Original file line number Diff line number Diff line change 172172 <string name =" useCustomFontSummary" >Choose between lato or system default font</string >
173173 <string name =" userInterface" >User interface</string >
174174 <string name =" instanceId" >(ID: <xliff : g example =" abc134_GTF" id =" instanceIdString" >%1$s</xliff : g >)</string >
175- <string name =" onlyPositiveIntegersAllowed" >Only positive integers are allowed.</string >
175+ <string name =" onlyPositiveIntegersAllowed" >Only positive integers are allowed</string >
176+ <string name =" errorLoadingInputFile" >Error loading input file</string >
176177</resources >
You can’t perform that action at this time.
0 commit comments