Skip to content

Commit 43a3162

Browse files
committed
fix magic current_raw_offset when no BV open
1 parent a5608df commit 43a3162

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def run(self):
259259
self.context.binaryView.file.navigate(self.context.binaryView.file.view, snippetGlobals['here'])
260260
if "current_address" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_address'] != self.context.address:
261261
self.context.binaryView.file.navigate(self.context.binaryView.file.view, snippetGlobals['current_address'])
262-
if "current_raw_offset" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_raw_offset'] != self.context.binaryView.get_data_offset_for_address(self.context.address):
262+
if self.context.binaryView is not None and "current_raw_offset" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_raw_offset'] != self.context.binaryView.get_data_offset_for_address(self.context.address):
263263
addr = self.context.binaryView.get_address_for_data_offset(snippetGlobals["current_raw_offset"])
264264
if addr is not None:
265265
if not self.context.binaryView.file.navigate(self.context.binaryView.file.view, addr):

0 commit comments

Comments
 (0)