File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,10 +296,17 @@ internal IEnumerator LoadImage(string url)
296296 // Load an image from a string that contains the
297297 // "data:image/png;base64," prefix
298298 string byteString = url . Substring ( base64Prefix . Length ) ;
299- byte [ ] bytes = Convert . FromBase64String ( byteString ) ;
300- if ( ! texture . LoadImage ( bytes ) )
299+ try
301300 {
302- Debug . Log ( "Could not parse image from base64 string." ) ;
301+ byte [ ] bytes = Convert . FromBase64String ( byteString ) ;
302+ if ( ! texture . LoadImage ( bytes ) )
303+ {
304+ Debug . Log ( "Credit image could not be loaded into Texture2D." ) ;
305+ }
306+ }
307+ catch ( FormatException e )
308+ {
309+ Debug . Log ( "Could not parse credit image from base64 string." ) ;
303310 }
304311 }
305312 else
@@ -311,7 +318,7 @@ internal IEnumerator LoadImage(string url)
311318 if ( request . result == UnityWebRequest . Result . ConnectionError ||
312319 request . result == UnityWebRequest . Result . ProtocolError )
313320 {
314- Debug . Log ( request . error ) ;
321+ Debug . LogError ( request . error ) ;
315322 }
316323 else
317324 {
You can’t perform that action at this time.
0 commit comments