File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -704,22 +704,29 @@ define([
704704 _animationComplete : function ( ) {
705705 logger . debug ( this . id + "._animationComplete" ) ;
706706 if ( this . base64Attr ) {
707- this . _mxObj . set ( this . base64Attr , this . _getBase64StringFromCanvasWithBackground ( "white" ) ) ;
707+ var base64String = this . _getBase64StringFromCanvasWithBackground ( "white" ) ;
708+ if ( base64String ) {
709+ this . _mxObj . set ( this . base64Attr , base64String ) ;
710+ }
708711
709712 }
710713 } ,
711714
712715 /**
713716 * Get Base64 String From Canvas Node with Background
714717 * ---
718+ * @since Dec 7, 2017
719+ * + returns null if the canvasNode is undefined
715720 * @author Conner Charlebois
716721 * @since 10 Nov, 2017
717722 * @param {String } backgroundColor - CSS color for the background fill
718723 * @returns {String } - the base64 String with the background fill applied.
719724 * @see https://stackoverflow.com/a/44174406/1513051
725+ *
720726 */
721727 _getBase64StringFromCanvasWithBackground : function ( backgroundColor ) {
722728
729+ if ( ! this . canvasNode ) return null ;
723730 var context = this . canvasNode . getContext ( '2d' ) ;
724731 var canvas = context . canvas ;
725732 //cache height and width
@@ -748,4 +755,4 @@ define([
748755 }
749756
750757 } ) ;
751- } ) ;
758+ } ) ;
You can’t perform that action at this time.
0 commit comments