[spv-out] Add check for global variables if name is set

This commit is contained in:
Timo de Kort authored and Dzmitry Malyshau committed 2020-10-05 09:43:59 -04:00
1 parent 90c56aca2f
commit 99f829b3cc
1 file changed
+4 -4
+4 -4
View File
@@ -670,10 +670,10 @@ impl Writer {
let instruction = super::instructions::instruction_variable(pointer_id, id, class, None);
if self.writer_flags.contains(WriterFlags::DEBUG) {
self.debugs.push(super::instructions::instruction_name(
id,
global_variable.name.as_ref().unwrap().as_str(),
));
if let Some(ref name) = global_variable.name {
self.debugs
.push(super::instructions::instruction_name(id, name.as_str()));
}
}
if let Some(interpolation) = global_variable.interpolation {