wfansh 6 месяцев назад
Родитель
Сommit
d8ed2771f9

+ 2 - 1
src/main/java/com/wechi/adweb/bridge/google/common/ResourceDTO.java

@@ -1,6 +1,7 @@
 package com.wechi.adweb.bridge.google.common;
 
 import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
 
 import lombok.Data;
 import lombok.experimental.SuperBuilder;
@@ -26,6 +27,6 @@ public abstract class ResourceDTO implements Serializable {
     /** Parses ID from the resource name. */
     public static String parseId(String resourceName) {
         List<String> parts = Splitter.on(RESOURCE_NAME_SPLITTER).splitToList(resourceName);
-        return parts.size() == 2 ? parts.get(1) : null;
+        return parts.isEmpty() ? null : Iterables.getLast(parts);
     }
 }