Skip to content

Commit

Permalink
Fix loadAssetFileFrom: reading from closed stream
Browse files Browse the repository at this point in the history
readAssetFrom: sometimes closes the stream (in the case of images).
  • Loading branch information
MariusDoe committed Nov 18, 2024
1 parent 3d2be42 commit 9c24f5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ loadAssetFileFrom: aFileSystem
| reference |
reference := self referenceIn: aFileSystem.
reference isFile ifFalse: [^ nil].
^ reference readStreamDo: [:stream |
self readAssetFrom: stream. "check for errors (will be thrown)"
stream reset.
GSAssetFile withMapper: self fromStream: stream]
reference readStreamDo: [:stream | self readAssetFrom: stream]. "check for errors (will be thrown)"
^ reference readStreamDo: [:stream | GSAssetFile withMapper: self fromStream: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"isMissing:" : "mad 11/16/2024 15:06",
"isValidAsset:" : "mad 9/29/2024 17:39",
"kind" : "mad 9/29/2024 19:28",
"loadAssetFileFrom:" : "mad 11/12/2024 19:10",
"loadAssetFileFrom:" : "mad 11/18/2024 19:57",
"loadAssetFileFromImage:" : "mad 9/29/2024 16:35",
"loadAssetFromImage:" : "mad 9/29/2024 17:42",
"mappedPathPatterns" : "mad 10/9/2024 16:01",
Expand Down

0 comments on commit 9c24f5e

Please sign in to comment.