Quellcode durchsuchen

Merge pull request #6349 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.4.3

Bump spotbugs-gradle-plugin from 4.3.0 to 4.4.3
Andy Scherzinger vor 4 Jahren
Ursprung
Commit
c3f838d445
2 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 5 1
      build.gradle
  2. 3 1
      src/main/java/com/owncloud/android/utils/FileStorageUtils.java

+ 5 - 1
build.gradle

@@ -23,7 +23,7 @@ buildscript {
     dependencies {
         classpath 'com.android.tools.build:gradle:4.0.0'
         classpath('com.hiya:jacoco-android:0.2')
-        classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.3.0'
+        classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.3'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
         classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
@@ -392,6 +392,10 @@ dependencies {
     androidTestImplementation 'net.bytebuddy:byte-buddy:1.10.12'
 }
 
+spotbugs {
+    toolVersion = '3.1.12'
+}
+
 configurations.all {
     resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
 }

+ 3 - 1
src/main/java/com/owncloud/android/utils/FileStorageUtils.java

@@ -189,7 +189,9 @@ public final class FileStorageUtils {
 
     public static String getParentPath(String remotePath) {
         String parentPath = new File(remotePath).getParent();
-        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR;
+        if (parentPath != null) {
+            parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR;
+        }
         return parentPath;
     }