Merge "Handle empty tshark file in switch latency test"
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index 87e9ca1..b81a674 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -195,6 +195,12 @@
             with open( main.tsharkResultPath[ switchStatus ][ d ], "r" ) as resultFile:
                 # grep tshark result timestamp
                 resultText = resultFile.readlines()
+                if not resultText:
+                    main.log.warn( "Empty tshark result!" )
+                    main.wrong[ 'TsharkValueIncorrect' ] += 1
+                    main.wrong[ 'totalWrong' ] += 1
+                    checkTotalWrongNum()
+                    return
                 if d == "TCP":
                     # if TCP package, we should use the latest one package
                     resultText = resultText[ len( resultText ) - 1 ]