elimu-ai / appstore

📲 Android application which downloads, installs and updates APK files stored on the elimu.ai platform.
MIT License
23 stars 7 forks source link

Fix bug: NullPointerException when no ApplicationVersion exists for installed APK #224

Closed nya-elimu closed 4 years ago

nya-elimu commented 4 years ago

To prevent crash during development (before any ApplicationVersion) has been uploaded to the webapp.

2020-07-04 11:04:31.473 28002-28002/ai.elimu.appstore.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ai.elimu.appstore.debug, PID: 28002
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Integer ai.elimu.appstore.room.entity.ApplicationVersion.getVersionCode()' on a null object reference
        at ai.elimu.appstore.ui.applications.ApplicationListAdapter.onBindViewHolder(ApplicationListAdapter.java:92)
        at ai.elimu.appstore.ui.applications.ApplicationListAdapter.onBindViewHolder(ApplicationListAdapter.java:34)