diff --git a/android/gradle.properties b/android/gradle.properties
index c8bbff9bd599a7c3ffbe76de5a61ead3de90631a..4d8dcd2635bb8701e212029096d53cf5dc060e45 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,5 +1,5 @@
 org.gradle.jvmargs=-Xmx1536M
 android.useAndroidX=true
 android.enableJetifier=true
-app.versionName=0.0.39
-app.versionCode=39
+app.versionName=0.0.40
+app.versionCode=40
diff --git a/fastlane/metadata/android/en-US/changelogs/40.txt b/fastlane/metadata/android/en-US/changelogs/40.txt
new file mode 100644
index 0000000000000000000000000000000000000000..dfddc5f66378086b9b38815d40b05b07828a7468
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/40.txt
@@ -0,0 +1 @@
+Fix compute "top artists" data.
diff --git a/fastlane/metadata/android/fr-FR/changelogs/40.txt b/fastlane/metadata/android/fr-FR/changelogs/40.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6430589f2b47e185babb060ee575446d714f2710
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/40.txt
@@ -0,0 +1 @@
+Correction sur calcul des données "top artistes".
diff --git a/lib/models/topartists.dart b/lib/models/topartists.dart
index a53f60e4c6eb4d1e2b48c77d00fc47fa8c408b04..47013c8445cae37fce5025b3a22f7933906eb617 100644
--- a/lib/models/topartists.dart
+++ b/lib/models/topartists.dart
@@ -55,7 +55,7 @@ class TopArtistsData {
     List<TopArtistsDataValue> topArtists = [];
     Map<String, List<TopArtistsStreamDataValue>> topArtistsStream = {};
 
-    json?['top-artists'].forEach((element) {
+    json?['top-artists']?.forEach((element) {
       TopArtistsDataValue value = TopArtistsDataValue(
         artistName: element['artistName'] as String,
         count: element['count'] as int,
@@ -64,7 +64,7 @@ class TopArtistsData {
       topArtists.add(value);
     });
 
-    json?['top-artists-stream-by-date'].keys.forEach((date) {
+    json?['top-artists-stream-by-date']?.keys?.forEach((date) {
       if (json['top-artists-stream-by-date'][date] is Map<String, dynamic>) {
         Map<String, dynamic> content = json['top-artists-stream-by-date'][date];
 
diff --git a/pubspec.yaml b/pubspec.yaml
index 2a55e387cde6b464793416530810b03057f0607c..a0731a7a9c55a867e0161e81c8ea697847593f7e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
 
 publish_to: 'none'
 
-version: 0.0.39+39
+version: 0.0.40+40
 
 environment:
   sdk: '^3.0.0'