scripts: Fixed the calculate section size error with NoneType [1/1]

PD#SWPL-90928

Problem:
Fixed the calculate section size error with NoneType.

Solution:
Fixed the calculate section size error with NoneType.

Verify:
N/A

Change-Id: I934de9ba5fc3d99556f53d469811b713c5aab761
Signed-off-by: xiaohu.huang <xiaohu.huang@amlogic.com>
diff --git a/map_analyzer_gcc_xcc.py b/map_analyzer_gcc_xcc.py
index 49f5643..8c91d70 100755
--- a/map_analyzer_gcc_xcc.py
+++ b/map_analyzer_gcc_xcc.py
@@ -34,6 +34,8 @@
     def total(self):
         return self.text + self.data + self.bss
     def add_gcc_section(self, section, size):
+        if current_section is None:
+            return;
         if section.startswith('.comment'):
             return
         if section.startswith('.debug'):
@@ -57,6 +59,8 @@
                 print("customer section:%s, size:%d" % (section, size))
                 self.customize += size
     def add_xcc_section(self, section, size):
+        if current_section is None:
+            return;
         if section.startswith('.comment'):
             return
         if section.startswith('.debug'):