Skip to content

Commit

Permalink
[spv-out] Add check for global variables if name is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Napokue authored and kvark committed Oct 5, 2020
1 parent 90c56ac commit 99f829b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/back/spv/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 99f829b

Please sign in to comment.