This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 239aea5d2a4 [fix](restore) avoid NPE for restore job #36395 (#45292)
239aea5d2a4 is described below

commit 239aea5d2a4785575e9300d51357f590e8692c29
Author: walter <maoch...@selectdb.com>
AuthorDate: Wed Dec 11 18:44:55 2024 +0800

    [fix](restore) avoid NPE for restore job #36395 (#45292)
    
    cherry pick from #36395
    
    Co-authored-by: Xujian Duan <50550370+darvend...@users.noreply.github.com>
---
 .../src/main/java/org/apache/doris/catalog/OlapTable.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
index 21e43179436..463f335d878 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
@@ -830,12 +830,14 @@ public class OlapTable extends Table implements 
MTMVRelatedTableIf {
         }
 
         // reset the indexes and update the indexes in materialized index meta 
too.
-        List<Index> indexes = this.indexes.getIndexes();
-        for (Index idx : indexes) {
-            idx.setIndexId(env.getNextId());
-        }
-        for (Map.Entry<Long, MaterializedIndexMeta> entry : 
indexIdToMeta.entrySet()) {
-            entry.getValue().setIndexes(indexes);
+        if (this.indexes != null) {
+            List<Index> indexes = this.indexes.getIndexes();
+            for (Index idx : indexes) {
+                idx.setIndexId(env.getNextId());
+            }
+            for (Map.Entry<Long, MaterializedIndexMeta> entry : 
indexIdToMeta.entrySet()) {
+                entry.getValue().setIndexes(indexes);
+            }
         }
 
         return Status.OK;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to