diff --git a/pkg/services/alerting/notifiers/telegram.go b/pkg/services/alerting/notifiers/telegram.go
index <HASH>..<HASH> 100644
--- a/pkg/services/alerting/notifiers/telegram.go
+++ b/pkg/services/alerting/notifiers/telegram.go
@@ -137,6 +137,10 @@ func (tn *TelegramNotifier) buildMessageInlineImage(evalContext *alerting.EvalCo
 	var err error
 
 	imageFile, err = os.Open(evalContext.ImageOnDiskPath)
+	if err != nil {
+		return nil, err
+	}
+
 	defer func() {
 		err := imageFile.Close()
 		if err != nil {
@@ -144,10 +148,6 @@ func (tn *TelegramNotifier) buildMessageInlineImage(evalContext *alerting.EvalCo
 		}
 	}()
 
-	if err != nil {
-		return nil, err
-	}
-
 	ruleURL, err := evalContext.GetRuleURL()
 	if err != nil {
 		return nil, err
Telegram: Check error before adding defer close of image (#<I>)

Properly handles file opening error and returns before deferring 

close of file.



Fixes #<I>