Check for empty flags list

IndexErrors are not fun.
This commit is contained in:
Strahinja Val Markovic 2013-05-28 09:43:13 -07:00
parent 80dd5c2317
commit 3948b6efe2

View File

@ -22,6 +22,6 @@ def PrepareClangFlags( flags, filename ):
# When flags come from the compile_commands.json file, the first flag is # When flags come from the compile_commands.json file, the first flag is
# usually the path to the compiler that should be invoked. We want to strip # usually the path to the compiler that should be invoked. We want to strip
# that. # that.
if not flags[ 0 ].startswith( '-' ): if flags and not flags[ 0 ].startswith( '-' ):
return flags[ 1: ] return flags[ 1: ]
return flags return flags